1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-15 02:35:41 +02:00
tldr/pages/common/vitest.md
Managor ba6daef39d
*: standardize regex usage (#17328)
Co-authored-by: Dylan <145150333+dmmqz@users.noreply.github.com>
2025-07-25 08:50:06 +03:00

36 lines
864 B
Markdown

# vitest
> Fast, modern testing framework built for Vite, offering seamless integration, TypeScript support, and a Jest-compatible API for unit, integration, and snapshot testing.
> More information: <https://vitest.dev/guide>.
- Run all available tests:
`vitest run`
- Run the test suites from the given files:
`vitest run {{path/to/file1 path/to/file2 ...}}`
- Run the test suites from files within the current and subdirectories, whose paths match the given `regex`:
`vitest run {{regex1}} {{regex2}}`
- Run the tests whose names match the given `regex`:
`vitest run --testNamePattern {{regex}}`
- Watch files for changes and automatically re-run related tests:
`vitest`
- Run tests with coverage:
`vitest run --coverage`
- Run all tests but stops immediately after the first test failure:
`vitest run --bail=1`
- Display help:
`vitest --help`