Next generation testing framework powered by Vite.
Next generation testing framework powered by Vite.
Documentation | Getting Started | Examples | Why Vitest?
v8 or istanbul.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 vitestThanks to:
See Contributing Guide.
MIT License © 2021-Present VoidZero Inc. and Vitest contributors
FOSS vulnerability scans identify dependency `convert-source-map` as not maintained / abandoned
Dependency Dashboard
Coverage: covered files with `(` or `[` in their path are re-processed as uncovered, and istanbul can record another module's coverage for an uncovered file
browser-playwright: failure screenshot fails with strict mode violation when there are 2 `<body>` elements
HMR overlay captures test clicks and cannot be disabled
Timeout during test context setup makes all retries fail
isolate: false: `test.env` is no longer reapplied before each file in a reused worker (regression from 4.1.11)
Optimize html reporter module graph data
Make `.vitest` artifact directory configurable
Browser mode hangs for ever when a test iframe never fires `load`