Vitest is a test runner that reuses Vite’s transform pipeline directly to execute your tests. Once you grasp this single fact, everything connects on one line: why TypeScript runs with zero config, why `vi.mock` takes effect before your imports, why Promises don’t resolve under fake timers. This course builds up that “how it works” understanding systematically through 50 hands-on drills.
Learning follows a roadmap of 10 chapters. Chapter 0 nails down Vitest’s execution model. Chapter 1 covers the “three levels of equality” (`toBe` / `toEqual` / `toStrictEqual`), asymmetric matchers, and even writing your own custom matchers. Chapter 2 covers data-driven testing with `test.each` / `describe.each` / `test.for`; Chapter 3 covers hook execution order and the dependency graph and scope design of Vitest’s fixture mechanism `test.extend`.
Chapter 4 is a full system for mocks. The three-tier reset distinction of `mockClear` / `mockReset` / `mockRestore` that trips up so many learners, and the hoisting behavior of `vi.mock`, are made to click through running code. Chapter 5 conquers async testing end to end: `resolves` / `rejects`, fake timers × Promises, `vi.waitFor`, `test.concurrent`, and `retry` for flaky tests.






