Browse all series
TestingAdvanced10 episodes

Testing Vue

How in the world are we supposed to unit test Vue components? Is it even possible? Why, yes. Yes it is! I'll show you the full process, step by step. Not only will you learn the necessary tooling, but we'll also review the ins and outs of testing your client-side code.

Have you ever wanted to use TDD for your Vue components? I'll show you how.

Series episodes

TDD Your First Vue Component From Scratch

11m 23s

Start TDD with Vue by building your first component using vue-test-utils. Follow this friendly guide to set up dependencies and write effective tests from scratch.

Test Single File Components

3m 15s

Learn to test single-file Vue components by pre-compiling .vue files with webpack. Follow this friendly guide to level up your Vue testing workflow.

Setting Data and Asserting Styles

9m 14s

Learn to set component data with setData() and assert inline styles using hasStyles() for effective, clear Vue tests. Boost your testing skills with this friendly guide.

Implementation Details Versus Rendered Output

15m 37s

Explore when to test implementation details versus rendered UI output. Learn friendly, practical tips to write effective, maintainable tests with confidence.

Asserting Emitted Events

21m 14s

Learn to assert emitted events in Vue by building a CouponCode component with TDD. Follow this friendly guide to master event testing from scratch.

Hooking Into Laravel Mix

5m 19s

Learn how to hook into Laravel Mix’s webpack config and set up a fresh Laravel Vue testing workflow from scratch in this clear, friendly tutorial.

TDD a Question Component With Helper Functions

19m 13s

Build a reusable question component with TDD, using helper functions like see(), click(), and type() to make your tests clear and easy to read.

Mocking Axios Calls

10m 11s

Learn how to easily mock Axios calls in Vue using Moxios. Explore practical testing techniques to handle AJAX requests with confidence and simplicity.

Testing Asynchronous Actions and Timers

25m 53s

Test async actions and timers: learn practical techniques for reliably testing dates, intervals, and time-based code with clear examples.

Cleaner Asynchronous Mocha Tests

8m 45s

Simplify Mocha tests with async/await: learn how asynchronous functions cleanly handle Vue's nextTick and streamline assertions.

Continue learning

Thumbnail for React from Scratch
React from Scratch

With Simon Vrachliotis

  • 27 episodes
  • Beginner
  • Frameworks
Thumbnail for ES2015 Crash Course
ES2015 Crash Course

With Jeffrey Way

  • 17 episodes
  • Intermediate
  • Languages
Thumbnail for GraphQL with Laravel and Vue
GraphQL with Laravel and Vue

With Andre Madarang

  • 16 episodes
  • Advanced
  • Tooling
Thumbnail for NuxtJS Crash Course
NuxtJS Crash Course

With Andre Madarang

  • 11 episodes
  • Intermediate
  • Frameworks
Thumbnail for Beginning React
Beginning React

With Andre Madarang

  • 19 episodes
  • Intermediate
  • Frameworks

Would you like to hear from Laracasts by email occasionally?