Next generation testing framework powered by Vite.
Next generation testing framework powered by Vite.
Documentation | Getting Started | Examples | Why Vitest?
v8
or istanbul
.Vitest 1.0 requires Vite >=v5.0.0 and Node >=v18.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 Anthony Fu, Matias Capeletto