Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Run TestDriver tests with Vitest test runner
.claude/skills/testdriverai-testdriver-running-tests/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -30% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -35% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 17% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 10% | 0% |
<!-- Generated from running-tests.mdx. DO NOT EDIT. -->
Learn how to run TestDriver tests efficiently with Vitest's powerful test runner.
TestDriver works with Vitest's powerful test runner.
<Info> Install Vitest globally for best results: npm install vitest -g </Info>
bashvitest 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.
bashvitest 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>
bashvitest run login.test.js
Runs only the specified test file. Useful when debugging a single test or working on a specific feature.
bashvitest run login.test.js checkout.test.js
Runs multiple specific test files. List as many files as needed, separated by spaces.
bashvitest 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.
bashvitest run tests/e2e/
Runs all test files within a specific directory. Great for organizing tests by type (unit, integration, e2e) and running them separately.
TestDriver runs each test in its own cloud sandbox, enabling true parallel execution. Run your entire test suite in minutes instead of hours.
bashvitest run --maxConcurrency=5
The --maxConcurrency flag limits how many tests run simultaneously. This should match your TestDriver license slots to avoid failures from exhausted slots.
bashvitest run --pool=threads --minThreads=2 --maxThreads=8
Fine-tune thread allocation for optimal performance:
--pool=threads — Uses worker threads for test isolation--minThreads — Minimum number of threads to keep alive (reduces startup overhead)--maxThreads — Maximum threads to spawn (limits resource usage)Your TestDriver plan includes a set number of license slots that determine how many tests can run simultaneously. Each running test occupies one slot—when the test completes and the sandbox is destroyed, the slot is immediately available for the next test.
<Info> View your available slots at console.testdriver.ai. Upgrade anytime to increase parallelization. </Info>
Set maxConcurrency in your Vitest config to match your license slot limit:
javascript vitest.config.mjsimport { defineConfig } from 'vitest/config'; import TestDriver from 'testdriverai/vitest'; export default defineConfig({ test: { testTimeout: 900000, hookTimeout: 900000, maxConcurrency: 5, // Match your license slot limit reporters: ['default', TestDriver()], setupFiles: ['testdriverai/vitest/setup'], }, });
<Warning> Setting maxConcurrency higher than your license slots will cause tests to fail when slots are exhausted. Always match this value to your plan's limit. </Warning>
| Test Suite | Sequential (1 slot) | Parallel (5 slots) | Parallel (10 slots) | |------------|--------------------|--------------------|---------------------| | 10 tests @ 2min each | 20 min | 4 min | 2 min | | 50 tests @ 2min each | 100 min | 20 min | 10 min | | 100 tests @ 2min each | 200 min | 40 min | 20 min |
<Tip> Pro tip: Upgrading your plan doesn't just increase speed—it enables faster CI/CD feedback loops, letting your team ship with confidence. </Tip>
<Card title="View Plans & Pricing" icon="credit-card" href="/v7/hosted" > Compare plans and find the right level of parallelization for your team. </Card>
Use Vitest UI for interactive debugging:
bashvitest --ui
The --ui flag launches a web-based interface for managing your test suite. Unlike vitest run, this starts in watch mode by default.
Open http://localhost:51204 to see:
<Tip> Combine with --open to automatically open the UI in your browser: vitest --ui --open </Tip>
After running tests, view detailed reports and video replays at console.testdriver.ai.
Reports include:
bash$ vitest run ✓ login.test.js (2) 18.4s ✓ user can login 12.3s ✓ shows error for invalid credentials 6.1s 📹 View reports at: https://console.testdriver.ai
<Tip> Bookmark your team's dashboard at console.testdriver.ai for quick access to test history and analytics. </Tip>
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 8,554 | 9,458 | +11% | 1 | 1 | 0% | 1,671 | 1,936 | +16% | 0 | 0 | — |
case-02 | fail→pass | 12,588 | 3,921 | -69% | 1 | 1 | 0% | 2,005 | 2,109 | +5% | 0 | 0 | — |
case-03 | pass→pass | 8,249 | 5,048 | -39% | 1 | 1 | 0% | 1,398 | 2,272 | +63% | 0 | 0 | — |
case-04 | pass→fail | 8,650 | 6,578 | -24% | 1 | 1 | 0% | 1,647 | 2,655 | +61% | 0 | 0 | — |
case-05 | pass→fail | 12,676 | 8,813 | -30% | 1 | 1 | 0% | 1,950 | 2,864 | +47% | 0 | 0 | — |
case-06 | pass→pass | 8,033 | 2,745 | -66% | 1 | 1 | 0% | 1,497 | 1,927 | +29% | 0 | 0 | — |
case-07 | fail→pass | 17,565 | 2,821 | -84% | 1 | 1 | 0% | 2,882 | 2,019 | -30% | 0 | 0 | — |
case-08 | pass→pass | 9,868 | 2,743 | -72% | 1 | 1 | 0% | 1,682 | 1,922 | +14% | 0 | 0 | — |
case-09 | fail→pass | 15,490 | 1,574 | -90% | 1 | 1 | 0% | 2,515 | 1,646 | -35% | 0 | 0 | — |
case-10 | fail→pass | 9,893 | 3,228 | -67% | 1 | 1 | 0% | 1,728 | 2,028 | +17% | 0 | 0 | — |
case-11 | fail→pass | 12,038 | 2,634 | -78% | 1 | 1 | 0% | 1,807 | 1,993 | +10% | 0 | 0 | — |
case-12 | fail→pass | 12,395 | 3,303 | -73% | 1 | 1 | 0% | 1,965 | 1,905 | -3% | 0 | 0 | — |
case-13 | pass→pass | 5,906 | 1,898 | -68% | 1 | 1 | 0% | 1,169 | 1,757 | +50% | 0 | 0 | — |
case-14 | fail→pass | 8,929 | 1,583 | -82% | 1 | 1 | 0% | 1,387 | 1,692 | +22% | 0 | 0 | — |
case-20 | fail→pass | 9,709 | 2,133 | -78% | 1 | 1 | 0% | 1,518 | 1,787 | +18% | 0 | 0 | — |
case-15 | pass→pass | 3,121 | 1,304 | -58% | 1 | 1 | 0% | 550 | 1,670 | +204% | 0 | 0 | — |
case-16 | fail→pass | 10,666 | 2,948 | -72% | 1 | 1 | 0% | 1,792 | 1,961 | +9% | 0 | 0 | — |
case-17 | pass→pass | 13,268 | 1,756 | -87% | 1 | 1 | 0% | 2,123 | 1,749 | -18% | 0 | 0 | — |
case-18 | pass→pass | 4,220 | 1,912 | -55% | 1 | 1 | 0% | 774 | 1,778 | +130% | 0 | 0 | — |
case-19 | pass→pass | 9,208 | 1,324 | -86% | 1 | 1 | 0% | 1,162 | 1,608 | +38% | 0 | 0 | — |
case-21 | pass→pass | 3,262 | 2,273 | -30% | 1 | 1 | 0% | 443 | 1,902 | +329% | 0 | 0 | — |
case-22 | pass→pass | 7,711 | 2,206 | -71% | 1 | 1 | 0% | 1,406 | 1,792 | +27% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 22 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.