2021-12-20 05:02:49 +08:00
2021-12-12 21:03:22 +08:00
2021-12-19 01:10:40 +08:00
2021-12-20 04:56:16 +08:00
2021-12-19 01:10:40 +08:00
2021-12-18 20:22:30 +08:00
2021-12-18 11:34:27 +08:00
2021-12-15 11:58:55 +08:00
2021-12-15 11:58:55 +08:00
2021-12-12 09:02:05 +08:00
2021-12-14 05:05:17 +08:00
2021-12-20 04:56:16 +08:00

Vitest

A blazing fast unit test framework powered by Vite.

Get involved!



⚠️ 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 v16

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

Documentations

Read the documentations.

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

Credits

Thanks to:

  • @patak-dev for the awesome package name!
  • The Vite team for brainstorming the initial idea.
  • @pi0 for the idea and implementation of using Vite to transform and bundle the server code.
  • @lukeed for the work on uvu where we are inspired a lot from.

License

MIT License © 2021 Anthony Fu

Description
A Vite-native test framework. It's fast!
Readme MIT 149 MiB
Languages
TypeScript 94.4%
Vue 3.2%
JavaScript 2.2%
CSS 0.1%
HTML 0.1%