Skip to content

DerYeger/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.10 and Node >=v14

Follow the Getting Started Guide or learn why we are building a new test runner.

Documentation

Read the documentation.

Examples | Projects using Vitest

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

Sponsors

Anthony Fu 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

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 86.7%
  • Vue 9.2%
  • JavaScript 3.0%
  • Other 1.1%