Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vitest-dev/vitest
Next generation testing framework powered by Vite.
https://github.com/vitest-dev/vitest
test testing-tools vite
Last synced: 1 day ago
JSON representation
Next generation testing framework powered by Vite.
- Host: GitHub
- URL: https://github.com/vitest-dev/vitest
- Owner: vitest-dev
- License: mit
- Created: 2021-12-03T19:19:49.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-06T20:49:54.000Z (5 days ago)
- Last Synced: 2025-02-06T21:33:45.352Z (5 days ago)
- Topics: test, testing-tools, vite
- Language: TypeScript
- Homepage: https://vitest.dev
- Size: 38.3 MB
- Stars: 13,714
- Watchers: 52
- Forks: 1,261
- Open Issues: 357
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome - vitest-dev/vitest - Next generation testing framework powered by Vite. (TypeScript)
- awesome-faker - vitest - Next generation testing framework powered by Vite. (Projects using `@faker-js/faker`)
- fucking-awesome-vite - vitest - A Vite-native test framework. (Plugins / Framework-agnostic Plugins)
- awesome-github-repos - vitest-dev/vitest - Next generation testing framework powered by Vite. (TypeScript)
- awesome-luooooob - vitest-dev/vitest - Next generation testing framework powered by Vite. (TypeScript)
- awesome-web-dev - vitest
- awesome-vite - vitest - A Vite-native test framework. (Plugins / Framework-agnostic Plugins)
- awesome - Vitest - A test framework based on Vite. (Project Management)
- awesome-vite - Vitest - Unit testing powered by Vite (Pre-packed / Dev tools)
- awesome - vitest-dev/vitest - Next generation testing framework powered by Vite. (TypeScript)
- awesome - vitest-dev/vitest - Next generation testing framework powered by Vite. (TypeScript)
- stars - vitest - dev | 13707 | (TypeScript)
- stars - vitest - dev | 13666 | (TypeScript)
- awesome-engineering - vitest
README
Vitest
Next generation testing framework powered by Vite.
Documentation | Getting Started | Examples | Why Vitest?
## Features
- [Vite](https://vitejs.dev/)'s config, transformers, resolvers, and plugins. Use the same setup from your app!
- [Jest Snapshot](https://jestjs.io/docs/snapshot-testing)
- [Chai](https://www.chaijs.com/) built-in for assertions, with [Jest expect](https://jestjs.io/docs/expect) compatible APIs
- [Smart & instant watch mode](https://vitest.dev/guide/features.html#watch-mode), like HMR for tests!
- [Native code coverage](https://vitest.dev/guide/features.html#coverage) via [`v8`](https://v8.dev/blog/javascript-code-coverage) or [`istanbul`](https://istanbul.js.org/).
- [Tinyspy](https://github.com/tinylibs/tinyspy) built-in for mocking, stubbing, and spies.
- [JSDOM](https://github.com/jsdom/jsdom) and [happy-dom](https://github.com/capricorn86/happy-dom) for DOM and browser API mocking
- [Browser Mode](https://vitest.dev/guide/browser/) for running component tests in the browser
- Components testing ([Vue](https://github.com/vitest-tests/browser-examples/tree/main/examples/vue), [React](https://github.com/vitest-tests/browser-examples/tree/main/examples/react), [Svelte](https://github.com/vitest-tests/browser-examples/tree/main/examples/svelte), [Lit](./examples/lit), [Marko](https://github.com/marko-js/examples/tree/master/examples/library-ts))
- Workers multi-threading via [Tinypool](https://github.com/tinylibs/tinypool) (a lightweight fork of [Piscina](https://github.com/piscinajs/piscina))
- Benchmarking support with [Tinybench](https://github.com/tinylibs/tinybench)
- [Workspace](https://vitest.dev/guide/workspace) support
- [expect-type](https://github.com/mmkal/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
```ts
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()
})
})
``````bash
$ npx vitest
```## Sponsors
### Vladimir Sponsors
### Anthony Fu Sponsors
### Patak Sponsors
## Credits
Thanks to:
- [The Jest team and community](https://jestjs.io/) for creating a delightful testing API
- [@lukeed](https://github.com/lukeed) for the work on [uvu](https://github.com/lukeed/uvu) where we are inspired a lot from.
- [@pi0](https://github.com/pi0) for the idea and implementation of using Vite to transform and bundle the server code.
- [The Vite team](https://github.com/vitejs/vite) for brainstorming the initial idea.
- [@patak-dev](https://github.com/patak-dev) for the awesome package name!## Contribution
See [Contributing Guide](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md).## License
[MIT](./LICENSE) License © 2021-Present [Anthony Fu](https://github.com/antfu), [Matias Capeletto](https://github.com/patak-dev)