Next generation testing framework powered by Vite.
Documentation | Getting Started | Examples | Why Vitest?
v8 or istanbul.Vitest requires Vite >=v6.0.0 and Node >=v20.0.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
Thanks to:
See Contributing Guide.
MIT License © 2021-Present VoidZero Inc. and Vitest contributors
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.