vitest-dev/vitest
Fork: 1159 Star: 12993 (更新于 2024-10-30 21:35:41)
license: MIT
Language: TypeScript .
Next generation testing framework powered by Vite.
最后发布版本: v2.1.0-beta.6 ( 2024-08-20 21:19:10)
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-09-04 23:34:21)
2024-08-20 21:19:10 v2.1.0-beta.6
2024-08-12 19:48:47 v2.1.0-beta.5
2024-08-07 19:43:31 v2.1.0-beta.4
2024-08-07 16:17:43 v2.1.0-beta.3
2024-08-07 15:57:30 v2.1.0-beta.2
2024-08-07 14:22:06 v2.1.0-beta.1
2024-07-31 18:40:41 v2.0.5
2024-07-22 17:14:05 v2.0.4
2024-07-15 18:04:12 v2.0.3
2024-07-10 23:47:17 v2.0.2
主题(topics):
test, testing-tools, vite
vitest-dev/vitest同语言 TypeScript最近更新仓库
2024-11-22 01:36:46 twentyhq/twenty
2024-11-21 16:58:07 labring/FastGPT
2024-11-21 16:14:54 RSSNext/Follow
2024-11-21 14:41:29 continuedev/continue
2024-11-21 00:40:00 immich-app/immich
2024-11-20 19:46:23 CopilotKit/CopilotKit