Skip to main content
CF

Rapid Testing with Vitest: Master Unit Testing & Mocking

1h 15m 44s
English
Paid

Rapid Testing with Vitest: Master Unit Testing & Mocking is a 26-lesson 1 hour 15 minutes self-paced course by Vue School. In this course the creator of Vitest, Anthony Fu, will get you up and running with the fastest testing framework around.

Course facts

Lessons
26
Duration
1 hour 15 minutes
Level
All levels
Language
English
Updated
Instructor
Vue School
Price
Premium

In this course the creator of Vitest, Anthony Fu, will get you up and running with the fastest testing framework around.

Learn the basics of how to do unit testing, why it's important, and how to be more confident shipping to production. Even if you are brand new to unit testing, don't worry! Anthony will start with the fundamentals and work up to more advanced topics such as mocking and spying.

Learn the benefits of TDD (Test Driven Development) and practice using the approach to build a simple deep merge function. In the process, get familiar with Vitest syntax and best practices. Test both expected functionalities and that unexpected input throws the proper errors.

Finally, experience the blazing fast feedback loop testing with Vitest provides and get hot tips from an avid open source developer who uses Vitest in a variety of real worl projects including: Vite, Slidedev, UnoCSS, and even Vitest is tested with Vitest!

Additional

https://github.com/vueschool/rapid-testing-with-vitest/

Who teaches Rapid Testing with Vitest: Master Unit Testing & Mocking? Vue School

Vue School thumbnail

Vue School (vueschool.io) is a Greece-based Vue.js training platform founded by Alex Kyriakidis, an early Vue community member and one of the longest-running independent Vue educators. Vue School operates as both an on-demand course platform and a Vue / Nuxt consulting business, with course material that often emerges from real client engagements.

Course material covers the full Vue ecosystem: Vue 3 fundamentals through advanced Composition API patterns, Nuxt 3 production deployment, Pinia state management, Vue Router, the testing track with Vitest, TypeScript with Vue, real-time features with Pusher / WebSockets, and the broader full-stack Vue work. Vue School also publishes the popular Mastering Pinia course in collaboration with Pinia's author Eduardo San Martín Morote.

The CourseFlix listing under this source carries over 30 Vue School courses spanning that range. Material is paid; Vue School runs on per-course or membership pricing on the original platform. Courses are aimed at Vue developers from beginner through senior level building production Vue applications.

What lessons are included in Rapid Testing with Vitest: Master Unit Testing & Mocking?

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 26 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Introduction to Vitest
All Course Lessons (26)
#Lesson TitleDurationAccess
1
Introduction to Vitest Demo
01:43
2
How to Install Vitest
03:19
3
Your First Test
02:56
4
Improve the Sum Function
03:25
5
A Deep Merge Function - The Goal
02:07
6
Handle and Test a Shallow Merge
04:08
7
Refactor for Deep Merge without Breaking Existing Tests
03:45
8
Expect for Errors In Tests
05:05
9
Snapshots in Vitest
02:15
10
How to Update Snapshots
02:47
11
Inline Snapshots in Vitest
03:06
12
Intro to Mocking and Spying
01:12
13
Spying Side Effects with Vitest
02:34
14
The Spy Instance
03:36
15
Mock JavaScript Modules with Vitest
04:27
16
Mocking Time in Vitest
01:49
17
Mocking Timers in Vitest
03:53
18
Mocking Network Requests in Vitest
05:57
19
Extra- Setup File
01:50
20
Testing with Vue
02:02
21
Testing Vue.js Composables First
03:10
22
Set up a DOM Environment in Vitest
02:41
23
Conditional Environments in Vitest
02:46
24
Setup for Testing Vue Components
01:46
25
Vue Test Utils
02:03
26
Course Conclusion
01:22
Unlock unlimited learning

Get instant access to all 25 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

What courses are similar to Rapid Testing with Vitest: Master Unit Testing & Mocking?

Frequently asked questions

What prerequisites should I have before enrolling?
Prospective students should have a basic understanding of JavaScript as the course involves testing JavaScript modules using Vitest. Familiarity with concepts such as functions, modules, and error handling will be beneficial. No prior experience with testing frameworks is necessary, as the course starts with fundamental concepts and builds up to more advanced topics.
What projects will I work on during this course?
Students will work on building a simple deep merge function using Test Driven Development (TDD). This involves initially creating a shallow merge, refactoring for deep merging without breaking existing tests, and ensuring proper error handling. These exercises are designed to familiarize students with Vitest syntax and best practices in testing.
Who is the target audience for this course?
The course is designed for JavaScript developers interested in enhancing their skills in unit testing and mocking. It caters to both beginners new to testing and experienced developers looking to adopt faster testing frameworks like Vitest. The course content is particularly relevant for developers working on projects where rapid testing and feedback loops are crucial.
How does this course compare in depth and scope to other testing courses?
This course focuses specifically on Vitest, emphasizing rapid testing capabilities and best practices in unit testing and mocking. Unlike broader testing courses, it provides in-depth coverage of Vitest's features, including snapshots, mocking, and spying. It also uniquely addresses testing with Vue.js components, making it suitable for developers working within the Vue ecosystem.
What specific tools and platforms are covered in the course?
The course covers the Vitest testing framework extensively, including tools and techniques for mocking JavaScript modules, timers, and network requests. It also delves into testing Vue.js components using Vue Test Utils and setting up conditional environments for effective component testing.
What topics are not covered in the course?
The course does not cover other testing frameworks outside of Vitest, such as Jest or Mocha. It also does not delve into end-to-end testing or performance testing methodologies, focusing solely on unit testing and the specific capabilities of Vitest in this regard.
What is the expected time commitment for this course?
Although the total runtime of the course is not specified, it contains 26 lessons covering both fundamental and advanced topics. Students should allocate additional time for exercises and practical application of the concepts, particularly for the TDD approach and testing Vue.js components, to fully grasp the course material.