Skip to main content
CF

Testing Fundamentals [EpicWeb]

5h 16m 16s
English
Paid

In this workshop, Artem Zakharchenko, testing expert and creator of the Mock Service Worker API mocking library, will guide you through creating your own version of the Vitest testing framework.

Building a testing framework from scratch will give you a deep understanding of how the pieces fit together, and change the way you think about testing for the better.

What You'll Learn

The workshop is broken out into four parts, each with its own challenges and exercises that build upon the last:

Principles

First, you'll explore the principles and mental models that underlie testing strategies. This is where you will begin to distinguish between the intention of your code and its implementation details. When you focus the intention of what your code should accomplish, you can write tests that are more resilient to change.

Test Structure

Next, you'll do a deep dive into the structure of the testing framework. You'll create your own expect and test functions, configure your test environment, and use hooks to manage side effects in your tests.

Testing Asynchronous Code

Testing asynchronous code requires a slightly different approach when compared to testing synchronous code. Here you'll practice with testing promises and async functions, as well as handling errors and rejections.

Moving to Vitest

Once you've learned the fundamentals of testing and built your own mini-framework, you will migrate your tests to the Vitest framework. This process will cement your understanding of not just the "hows", but also the "whys" of testing.

Who This Workshop Is For

This workshop is for developers who have some testing experience, but feel like they're missing the bigger picture. If you're tired of writing tests that feel like a chore, and want to understand how to write tests that are actually useful, this workshop is for you.

Additional

https://github.com/epicweb-dev/testing-fundamentals

About the Author: Artem Zakharchenko

Artem Zakharchenko thumbnail

Artem Zakharchenko is a Ukrainian software engineer best known as the creator of Mock Service Worker (MSW) — the de-facto standard for API mocking in modern JavaScript test suites — and as a lead instructor on the EpicWeb.dev testing track alongside Kent C. Dodds.

His CourseFlix listing carries four Artem Zakharchenko courses: Testing Fundamentals (EpicWeb), Mocking Techniques in Vitest, Advanced Vitest Patterns, and React Component Testing with Vitest. Material is paid and aimed at JavaScript developers who want to make testing a first-class part of their workflow rather than an afterthought.

Watch Online 40 lessons

This is a demo lesson (10:00 remaining)

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

View Pricing
0:00
/
#1: Testing Fundamentals Workshop Introduction
All Course Lessons (40)
#Lesson TitleDurationAccess
1
Testing Fundamentals Workshop Introduction Demo
01:44
2
Overview of Testing Principles
01:11
3
Write an Intentional Test - PROBLEM
01:06
4
-----Ignore this video-------
27:31
5
Implement the Automated Greeting Test - SOLUTION
01:15
6
Debugging Intent vs. Implementation - PROBLEM
00:41
7
-----Ignore this video-------
27:31
8
Trusting Your Test - SOLUTION
00:28
9
Testing Principles Outro
00:15
10
Structure Your Tests
00:56
11
Imperative vs. Declarative Assertions - PROBLEM
01:08
12
-----Ignore this video-------
27:31
13
Implement a Declarative API - SOLUTION
02:01
14
Isolating Tests with Test Blocks - PROBLEM
00:59
15
-----Ignore this video-------
27:31
16
Create Test Blocks for Better Organization - SOLUTION
01:27
17
Move Tests into Modules - PROBLEM
00:55
18
-----Ignore this video-------
27:31
19
Modular Tests and Global Helpers - SOLUTION
03:23
20
Handle Test Side Effects - PROBLEM
01:26
21
-----Ignore this video-------
27:31
22
Implement Hooks for Test Setup & Cleanup - SOLUTION
03:52
23
Test Structure Recap
00:23
24
Overview of Testing Async Code
00:48
25
Handling Promises in Tests - PROBLEM
01:24
26
-----Ignore this video-------
27:31
27
Awaiting Async Tests - SOLUTION
01:55
28
Error Assertions for Rejected Promises - PROBLEM
00:43
29
-----Ignore this video-------
27:31
30
Handling Promise Rejections - SOLUTION
03:21
31
Testing with Async Side Effects - PROBLEM
01:53
32
-----Ignore this video-------
27:31
33
Reliably Wait for Async Operations - SOLUTION
03:19
34
Recap of Testing Asynchronous Code
00:22
35
Overview of Vitest
00:34
36
Migrate Tests to Vitest - PROBLEM
00:24
37
-----Ignore this video-------
27:31
38
Installing, Configuring, and Testing in Vitest - SOLUTION
02:28
39
Vitest Review
00:19
40
Testing Fundamentals Workshop Outro
00:26
Unlock unlimited learning

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

Learn more about subscription

Related courses

  • Mocking Techniques in Vitest thumbnailUpdated 2y ago

    Mocking Techniques in Vitest

    By: Artem Zakharchenko
    Let's admit it, mocking can be really confusing. First, you need to understand what exactly to mock.
    1h 30m
  • Test with Jest thumbnailUpdated 3y ago

    Test with Jest

    By: Vue School
    Jest is an industry leading test suite for JavaScript used by big and small projects around the globe. Get up and running with Jest in this course! In this cour
    52m
  • Automated Software Testing with Python thumbnailUpdated 2y ago

    Automated Software Testing with Python

    By: Udemy
    Testing automation doesn't have to be painful. Software testing is an essential skill for any developer, and I'm here to help you truly understand all types of
    13h 26m

Frequently asked questions

What are the prerequisites for enrolling in this course?
The course is designed for individuals who have a basic understanding of software testing concepts and JavaScript. Familiarity with testing tools and frameworks would be beneficial but is not mandatory, as the course starts with fundamental testing principles and gradually advances to building a testing framework.
What will I build during the course?
During the course, you will build your own version of the Vitest testing framework. This involves understanding and applying core testing principles, structuring tests, working with test blocks, handling asynchronous code, and implementing modular tests and global helpers.
Who is the target audience for this course?
The course is aimed at software developers and testers interested in gaining a deeper understanding of testing frameworks by building one from scratch. It is particularly beneficial for those who want to enhance their skills in JavaScript testing and learn about the inner workings of tools like the Vitest framework.
How does the depth of this course compare to others on testing?
This course offers a unique approach by focusing on building a testing framework from scratch, providing a deeper understanding of testing mechanisms. Unlike courses that only teach how to use existing frameworks, this workshop dives into the architecture and principles behind the tools, offering insights into both intentional and implementation aspects of testing.
What specific tools or platforms are covered in this course?
The course covers the Vitest testing framework, guiding you through migrating tests to Vitest, installing and configuring it, and conducting tests within this environment. Additionally, it provides insights into the Mock Service Worker library, created by the instructor.
What topics are not covered in this course?
The course does not cover topics related to performance testing, security testing, or other specialized testing areas outside the scope of unit and integration testing. It focuses primarily on understanding and building a foundational testing framework rather than exploring advanced testing domains.
What is the estimated time commitment for completing this course?
The course consists of 40 lessons. Although the total runtime is not specified, students should expect to spend additional time on exercises and projects, such as writing intentional tests, implementing automated tests, and handling asynchronous code, to fully grasp the concepts and complete the course effectively.