vitest-dev/vitest
Fork: 1210 Star: 13320 (更新于 2024-12-21 00:05:23)
license: MIT
Language: TypeScript .
Next generation testing framework powered by Vite.
最后发布版本: v3.0.0-beta.2 ( 2024-12-10 18:22:19)
Vitest
Next generation testing framework powered by Vite.
Documentation | Getting Started | Examples | Why Vitest?
Features
- Vite's config, transformers, resolvers, and plugins. Use the same setup from your app!
- Jest Snapshot
- Chai built-in for assertions, with Jest expect compatible APIs
- Smart & instant watch mode, like HMR for tests!
-
Native code coverage via
v8
oristanbul
. - Tinyspy built-in for mocking, stubbing, and spies.
- JSDOM and happy-dom for DOM and browser API mocking
- Browser Mode for running component tests in the browser
- Components testing (Vue, React, Svelte, Lit, Marko)
- Workers multi-threading via Tinypool (a lightweight fork of Piscina)
- Benchmarking support with Tinybench
- Workspace support
- expect-type for type-level testing
- ESM first, top level await
- Out-of-box TypeScript / JSX support
- Filtering, timeouts, concurrent for suite and tests
- Sharding support
- Run your tests in the browser natively (experimental)
Vitest requires Vite >=v5.0.0 and Node >=v18.0.0
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
Vladimir Sponsors
Anthony Fu Sponsors
Patak Sponsors
Credits
Thanks to:
- The Jest team and community for creating a delightful testing API
- @lukeed for the work on uvu where we are inspired a lot from.
- @pi0 for the idea and implementation of using Vite to transform and bundle the server code.
- The Vite team for brainstorming the initial idea.
- @patak-dev for the awesome package name!
Contribution
See Contributing Guide.
License
MIT License © 2021-Present Anthony Fu, Matias Capeletto
最近版本更新:(数据更新于 2024-12-21 00:04:39)
2024-12-10 18:22:19 v3.0.0-beta.2
2024-12-06 01:34:20 v3.0.0-beta.1
2024-12-02 22:46:59 v2.1.8
2024-12-02 17:49:44 v2.1.7
2024-11-26 20:24:34 v2.1.6
2024-11-18 22:18:45 v2.2.0-beta.2
2024-11-14 01:17:58 v2.2.0-beta.1
2024-11-13 23:24:47 v2.1.5
2024-10-28 20:27:59 v2.1.4
2024-10-14 19:06:11 v2.1.3
主题(topics):
test, testing-tools, vite
vitest-dev/vitest同语言 TypeScript最近更新仓库
2024-12-21 21:40:12 lobehub/lobe-chat
2024-12-21 12:01:51 siyuan-note/siyuan
2024-12-21 10:57:01 ai16z/eliza
2024-12-21 09:15:35 MetaCubeX/metacubexd
2024-12-20 19:36:48 vitejs/vite
2024-12-20 15:46:43 x-extends/vxe-table