vitest
vitest is an open-source TypeScript project with 16.7k GitHub stars. It is associated with test, testing-tools, vite. The repository is actively maintained, with recent commits.
MITPermissive — free to use in commercial and proprietary software, with attribution.View license →
Production readiness
4/5- Actively maintainedCommits in the last 6 months
- No known vulnerabilitiesNot yet scanned
- Clear, usable licenseMIT (permissive)
- Proven adoptionWidely used
- Has documentationDocumentation indexed
npm install vitestFeatures
Vite's config, transformers, resolvers, and plugins. Use the same setup from your app!
Chai built-in for assertions, with Jest expect compatible APIs
Smart & instant watch mode, like HMR for tests!
Native code coverage via
v8oristanbul.Jest-compatible mocking, stubbing, and spies.
Browser Mode for running component tests in the browser
Benchmarking support with Tinybench
Projects support
expect-type for type-level testing
ESM first, top level await
Out-of-box TypeScript / JSX support
Filtering, timeouts, concurrent for suite and tests
Sharding support
Reporting Uncaught Errors
Run your tests in the browser natively
Vitest requires Vite >=v6.4.0 and Node >=v22.12.0
import { assert, describe, expect, it } from 'vitest'
describe('suite name', () => {
it('foo', () => {
expect(1 + 1).toEqual(2)
expect(true).to.be.true
})
it('bar', () => {
assert.equal(Math.sqrt(4), 2)
})
it('snapshot', () => {
expect({ foo: 'bar' }).toMatchSnapshot()
})
})
$ npx vitest
Sponsors
Credits
Thanks to:
The Jest team and community for creating a delightful testing API
@lukeed for the work on uvu where we are inspired a lot from.
@pi0 for the idea and implementation of using Vite to transform and bundle the server code.
The Vite team for brainstorming the initial idea.
@patak-dev for the awesome package name!
Contribution
See Contributing Guide.
License
MIT License © 2021-Present VoidZero Inc. and Vitest contributors