Skip to content

aleclarson/vitest

 
 

Repository files navigation

Vitest

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.

Documentation

Read the documentation.

Features

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

Examples

Projects using Vitest

Sponsors

Anthony Fu Sponsors

Patak Sponsors

Credits

Thanks to:

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

Packages

No packages published

Languages

  • TypeScript 91.6%
  • Vue 3.8%
  • JavaScript 2.9%
  • Other 1.7%