Skip to content

feat: add --last-failed to run only failed tests - #11558

Merged
sheremet-va merged 3 commits into
mainfrom
feat/last-failed
Oct 19, 2026
Merged

sheremet-va merged 3 commits into
mainfrom
feat/last-failed

Conversation

@sheremet-va

Copy link
Copy Markdown
Member

Adds a CLI-only --last-failed flag that runs only the tests that failed in the last run.

  • results.json stores the full names of failed tests per file (failedTests). A failure outside of tests (hook, collection) reruns the whole file.
  • New TestSpecification.testNames filter. Names instead of ids, so adding or moving tests in the file keeps the selection.
  • Works with vitest list and other filters. In watch mode, only the first run is narrowed.

if (!isPartialRun(this.vitest, specification, task)) {
results.set(file, { failed, duration, lastRun: startTime })
let record: CachedTestFileResult
if (!isPartialRun(this.vitest, specification, testModule.task)) {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of a chaos to make sure partial run is recorded properly

@netlify

netlify Bot commented Oct 12, 2026

Copy link
Copy Markdown

✅ Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 3b0e838
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6accf1924e9b2afd42c83991
😎 Deploy Preview https://deploy-preview-11558--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sheremet-va
sheremet-va merged commit 82f6342 into main Oct 19, 2026
@sheremet-va
sheremet-va deleted the feat/last-failed branch October 19, 2026 08:43
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant