Vitest: Fast and Simple Testing Framework for Node

Vitest

Next generation testing framework powered by Vite.


Features

Vitest 1.0 requires Vite >=v5.0.0 and Node >=v18.00

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 

Credits

Thanks to:

Contribution

See Contributing Guide.


Get involved!

Documentation | Getting Started | Examples | Why Vitest?

中文文档'


Download Details:

Author: vitest-dev
Source Code: https://github.com/vitest-dev/vitest 
License: MIT license

#node #nodejs #test #testing #tools 

Vitest: Fast and Simple Testing Framework for Node
1.40 GEEK