robertgr991 / vitest

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

Home Page:https://vitest.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.18

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!

https://vitest.dev

License:MIT License


Languages

Language:TypeScript 91.5%Language:Vue 4.4%Language:JavaScript 3.5%Language:CSS 0.4%Language:HTML 0.2%Language:Imba 0.0%Language:SCSS 0.0%Language:Sass 0.0%