vitest-dev / vitest
- четверг, 23 декабря 2021 г. в 00:39:42
A Vite-native test framework. It's fast!
A blazing fast unit test framework powered by Vite.
⚠️ DISCLAIMER: Vitest is still in development and not stable yet. It's not recommended to use it in production.
Vitest requires Vite v2.7 and Node v14
Follow the Getting Started Guide or learn why we are building a new test runner.
Read the documentation.
import { it, describe, expect, assert } 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:
MIT License © 2021-Present Anthony Fu, Matias Capeletto