[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
TypeScript 93%
JavaScript 3%
Vue 3%
CSS <1%
HTML <1%
<1%
Marko <1%
Imba <1%
Svelte <1%
Less <1%
SCSS <1%
Sass <1%

README.md

Vitest

Next generation testing framework powered by Vite.

Get involved!

Documentation | Getting Started | Examples | Why Vitest?

中文文档



Features #

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

Sponsors #

Vladimir Sponsors #

Anthony Fu Sponsors #

Patak Sponsors #

Credits #

Thanks to:

Contribution #

See Contributing Guide.

License #

MIT License © 2021-Present Anthony Fu, Matias Capeletto