testdriverrunning-testslisted
Install: claude install-skill testdriverai/testdriverai
<!-- Generated from running-tests.mdx. DO NOT EDIT. -->
Learn how to run TestDriver tests efficiently with Vitest's powerful test runner.
## Running Tests
TestDriver works with Vitest's powerful test runner.
<Info>
Install Vitest globally for best results: `npm install vitest -g`
</Info>
### Run All Tests
```bash
vitest run
```
Executes all test files in your project once and exits. Vitest automatically discovers files matching patterns like `*.test.js`, `*.test.mjs`, or `*.spec.js`.
### Run with Coverage
```bash
vitest run --coverage
```
Generates a code coverage report showing which lines of your source code were executed during tests. Coverage helps identify untested code paths. Results are displayed in the terminal and saved to a `coverage/` directory.
<Info>
Coverage requires the `@vitest/coverage-v8` package. Install it with `npm install -D @vitest/coverage-v8`.
</Info>
### Run Specific Tests
```bash
vitest run login.test.js
```
Runs only the specified test file. Useful when debugging a single test or working on a specific feature.
```bash
vitest run login.test.js checkout.test.js
```
Runs multiple specific test files. List as many files as needed, separated by spaces.
### Filter Tests by Name
```bash
vitest run --grep "login"
```
The `--grep` flag filters tests by their name (the string passed to `it()` or `test()`). Only tests whose names match the pattern will run. Supports regex patterns for complex matching.
### Run Tests in a Folder
```bas