vitest-dev/vitest
Fork: 1033 Star: 11870 (更新于 2024-05-04 11:41:42)
license: MIT
Language: TypeScript .
Next generation testing framework powered by Vite.
最后发布版本: v1.6.0 ( 2024-05-03 23:23:02)
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
- Components testing (Vue, React, Svelte, Lit, Vitesse, 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
Vitest 1.0 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-05-04 11:41:26)
2024-05-03 23:23:02 v1.6.0
2024-04-30 16:41:11 v1.5.3
2024-04-25 17:12:49 v1.5.2
2024-04-24 19:23:06 v1.5.1
2024-04-12 01:48:46 v1.5.0
2024-03-15 18:31:50 v1.4.0
2024-02-20 21:49:18 v1.3.1
2024-02-17 01:32:34 v1.3.0
2024-01-27 00:25:18 v1.2.2
2024-01-18 00:23:35 v1.2.1
主题(topics):
test, testing-tools, vite
vitest-dev/vitest同语言 TypeScript最近更新仓库
2024-05-13 19:34:15 element-plus/element-plus
2024-05-13 15:09:39 x-extends/vxe-table
2024-05-13 13:39:54 labring/FastGPT
2024-05-13 12:43:17 toeverything/AFFiNE
2024-05-12 17:17:19 lobehub/lobe-chat
2024-05-12 12:54:11 siyuan-note/siyuan