Vitest 5.1 Adds Affected-Test Runs, Interactive Snapshot Reviews, and Failure-Only Traces
Vitest 5.1 introduces experimental affected-test execution, interactive snapshot review, and failure-only browser traces. These are the checks QA and development teams should make before upgrading.
Vitest 5.1 narrows fast feedback and simplifies browser-failure investigation
Released on November 2, 2026, Vitest 5.1 adds three changes for teams maintaining large JavaScript and TypeScript test suites: the experimental --since-last-run mode, interactive snapshot review, and stable Browser Trace View, enabled by default for failures.
The update is not a replacement for a full regression run, and affected-test execution remains experimental. It does give teams a practical way to shorten feedback during local development, AI-assisted coding, and incremental CI jobs without depending entirely on Git history.
What changed in Vitest 5.1?
1. Run tests affected since their previous execution
Vitest 5.1 adds the experimental command vitest run --since-last-run. During its first run, Vitest records the files loaded by each test, including imports, mocks, setup files, and snapshot files. On subsequent runs, it uses file modification times to select tests whose dependencies changed or were deleted.
A failed test remains eligible for reruns until it passes. That differs from Vitest's existing --changed option, which compares files with a Git reference. Because the new mode does not require a repository, it can also run in fresh containers, temporary worktrees, and environments without available commits.
This is a good fit for coding agents and developer workflows that make several small edits in sequence. A team can run the targeted command after each change, then run the complete suite before merging.
2. Review snapshots one at a time
Snapshot updates save time, but accepting every changed snapshot can hide a regression. Vitest 5.1 adds an interactive review flow in watch mode. Pressing i presents failed snapshots individually, so the user can accept the new result or keep the existing snapshot.
The flow supports inline snapshots, .snap files, file snapshots, and ARIA snapshots in Browser Mode. After the review, Vitest writes only the accepted changes and reruns the affected test files.
That gives teams a useful safeguard when UI changes are frequent. The tool does not decide whether a visual or structural change is correct; it puts that decision back in the update process instead of treating every diff as approved.
3. Browser Trace View is stable and focused on failures
Trace View, introduced experimentally in Vitest 5.0, is now stable and enabled by default in a new failure-only mode. Passing browser tests create neither DOM snapshots nor server trace data. Failed tests retain the interaction steps that led to the error.
Failure reports can show actions such as filling out a form, clicking a button, and evaluating an assertion, along with locators, durations, source locations, and a page snapshot from the failure point. The same trace is available in the browser UI, Vitest UI, and HTML reporter.
Teams already using Playwright for end-to-end coverage should compare this workflow with their current trace tooling. Vitest Trace View is built for Vitest Browser Mode; Playwright traces remain tied to Playwright's test runner and browser automation model.
Upgrade checks for QA teams
- Run
--since-last-runagainst tests with dynamic imports, generated files, setup hooks, and snapshots. Confirm that the selected tests match the expected change impact. - Keep a full-suite gate. Use affected-test execution to speed feedback, not to replace full regression testing before release.
- Test snapshot review with both accepted and rejected changes, including inline, file, and ARIA snapshots.
- Review browser trace storage before enabling broad collection. Failure traces can contain page state and test data, so check reporter output, artifact retention, and CI permissions.
- Check the platform baseline. Vitest 5 requires Vite 6.4.0 or newer and Node.js 22.12.0 or newer. Teams coming from older environments should verify their build images before changing the test dependency.
- Test custom reporters and integrations. Vitest 5 changed several APIs and defaults, including worker identifiers becoming one-based. Custom reporters, database naming logic, and CI plugins need targeted upgrade coverage.
Should you upgrade now?
Vitest 5.1 is a sensible upgrade for teams that want faster local feedback and already use a modern Vite-based test stack. Its clearest benefit is the combination of selective reruns and better failure evidence. Those features can cut wasted execution time without forcing developers to reproduce every problem manually.
The main warning is that --since-last-run is experimental. Start on developer workstations or in non-blocking CI jobs, compare its selections with full-suite results, and keep a complete run in the merge or release path. Teams upgrading from version 4 should also read the Vitest 5 migration guidance, especially if they rely on custom reporters, project inheritance, mock behavior, or browser screenshot configuration.
Looking for tools to match this read?
Jump into our independent side-by-side comparisons.
More in Tool Updates
.NET 11 Released: What QA Teams Need to Check in the New dotnet test
.NET 11 adds run-level test policies, clearer CI output, mobile test support, traversal projects, and new Microsoft.Testing.Platform options. QA teams should test these changes before upgrading.
GitHub Actions Secret Scanning Now Checks Workflow Logs: What QA Teams Need to Know
GitHub's public preview scans completed Actions workflow logs for leaked credentials. QA teams need to understand what it covers, how to enable it, and where it falls short before relying on it instead of disciplined test-pipeline hygiene.
SonarQube CLI 1.12.0 Adds Architecture Findings, Secret Redaction, and Simpler Project Administration
SonarQube CLI 1.12.0 adds architecture findings for SonarQube Cloud, redacts secrets in selected AI-agent workflows, and simplifies repository imports, project linking, and authentication management.