🧪Vitest
Also known as Vitest JS
A fast JavaScript test tool built on Vite, with an API much like Jest.
Think of it like
Think of it like a new bike. It is faster, but it rides just like your old one.
Example
Jack's Vite app moves from Jest to Vitest. His tests barely change, and the watch mode reruns a changed test in under a second.
Why it matters
Apps built with Vite get tests that share their settings, with no second set-up to keep in step.
Definition
Example code
console
$ npx vitest run
Tests 1 passed (1)Common mistake
Key takeaways
- 1Built on Vite. Shares its settings.
- 2Jest-like. Easy to switch.
- 3Fast reruns. Only what changed.