Skip to content

A Vite-native test framework. It's fast!

License

Notifications You must be signed in to change notification settings

mysteryven/vitest

 
 

Repository files navigation

Vitest

A blazing fast unit test framework powered by Vite.

Get involved!

Documentation | Getting Started | Examples | Why Vitest?

中文文档



Features

Vitest requires Vite >=v3.0.0 and Node >=v14

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

Anthony Fu Sponsors

Vladimir Sponsors

Patak Sponsors

Credits

Thanks to:

Contribution

See Contributing Guide.

License

MIT License © 2021-Present Anthony Fu, Matias Capeletto

About

A Vite-native test framework. It's fast!

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 90.9%
  • Vue 5.1%
  • JavaScript 3.3%
  • CSS 0.5%
  • HTML 0.2%
  • Imba 0.0%