Note
This repository is for learning and experimenting with vitest
This is a demo project that showcases examples and serves as a guide to implement vitest
with typescript
.
- Vitest -
Documentation
- Rapid Testing with Vitest -
Course
- Vitest Basic Example -
Github codebase
- Web.dev Learn Testing -
Course
npm run test # Run all tests on watch mode
npm run test sum # Run a specific test
Warning
Vitest will not mock modules that were imported inside a setup file
because they are cached by the time a test file is running. You can call vi.resetModules()
inside vi.hoisted
to clear all module caches before running a test file.