Skip to content

fix(reporters): keep the watch banner red while other files fail - #11070

Open
nundorn wants to merge 1 commit into
vitest-dev:mainfrom
nundorn:fix/watch-banner-ignores-unwatched-failures
Open

fix(reporters): keep the watch banner red while other files fail#11070
nundorn wants to merge 1 commit into
vitest-dev:mainfrom
nundorn:fix/watch-banner-ignores-unwatched-failures

Conversation

@nundorn

@nundorn nundorn commented Aug 27, 2026

Copy link
Copy Markdown

Fixes #10695.

On a rerun the banner reports PASS while the summary directly above it counts a failure:

 Test Files  1 failed | 1 passed (2)
      Tests  1 failed | 1 passed (2)

 PASS  Waiting for file changes...

onWatcherStart only receives the files from the run that just finished, so hasFailed(files) cannot see files that failed earlier and were not rerun. reportTestSummary already folds them in via failedUnwatchedFiles, which is why only the banner disagreed.

reporter-failed.test.ts already covered this scenario but waited for Waiting for file changes..., which is the PASS banner, so the old behaviour was pinned by the suite. That wait now expects the FAIL banner, and a second case covers fixing the failing file so the banner cannot get stuck red.

The discussion on #10695 also explored a separate PREVIOUS FAILS section. This PR does not attempt that.

Written by an AI agent (Claude Code) on behalf of @nundorn, who reviewed it before it was posted.

@github-actions

Copy link
Copy Markdown

Hello @nundorn. Your PR has been labeled maybe automated because it appears to have been fully generated by AI with no human involvement.

To keep your PR open, please follow these steps:

  • Confirm that you are a real human. If you are an automated agent, disclose that
  • Make sure you've read, reviewed and stand behind its content
  • Make sure you've read the full issue along with all of its comments, as well as any linked issues and their comments
  • Make sure it follows our contribution guidelines and uses the correct GitHub template
  • Disclose any AI tools you used (e.g. Claude, Copilot, Codex)

Please, do not generate or format the response with AI. If you do not speak English, reply in your native language or use translation software like Google Translate or Deepl. If the response is generated, the PR will be closed automatically.

These measures help us reduce maintenance burden and keep the team's work efficient. See our AI contributions policy for more context.

@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 67b9c72
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6a8fddcf0f0b010008936d69
😎 Deploy Preview https://deploy-preview-11070--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.

@nundorn
nundorn force-pushed the fix/watch-banner-ignores-unwatched-failures branch from 67b9c72 to 3e202b4 Compare August 27, 2026 06:51

@sheremet-va sheremet-va left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ask your code assistant to read AGENTS.md

Comment thread packages/vitest/src/node/reporters/base.ts Outdated
Comment thread test/e2e/test/watch/reporter-failed.test.ts Outdated
@nundorn
nundorn force-pushed the fix/watch-banner-ignores-unwatched-failures branch from 3e202b4 to 10809bf Compare August 27, 2026 07:55
@nundorn nundorn changed the title fix(reporters): keep the watch banner FAIL while unwatched files are failing fix(reporters): keep the watch banner red while other files fail Aug 27, 2026
`onWatcherStart` only receives the rerun files, so `hasFailed(files)`
misses files that failed earlier and were not rerun. `reportTestSummary`
already counts them via `failedUnwatchedFiles`, so only the banner
disagreed with the summary printed above it.

Fixes vitest-dev#10695
@nundorn
nundorn force-pushed the fix/watch-banner-ignores-unwatched-failures branch from 10809bf to 3f2efdb Compare August 27, 2026 08:02
@sheremet-va sheremet-va added the maybe automated User is likely an AI agent, or the content was generated by an AI assistant without user control label Aug 27, 2026
@github-actions

Copy link
Copy Markdown

Hello @nundorn. Your PR has been labeled maybe automated because it appears to have been fully generated by AI with no human involvement.

To keep your PR open, please follow these steps:

  • Confirm that you are a real human. If you are an automated agent, disclose that
  • Make sure you've read, reviewed and stand behind its content
  • Make sure you've read the full issue along with all of its comments, as well as any linked issues and their comments
  • Make sure it follows our contribution guidelines and uses the correct GitHub template
  • Disclose any AI tools you used (e.g. Claude, Copilot, Codex)

Please, do not generate or format the response with AI. If you do not speak English, reply in your native language or use translation software like Google Translate or Deepl. If the response is generated, the PR will be closed automatically.

These measures help us reduce maintenance burden and keep the team's work efficient. See our AI contributions policy for more context.

@sheremet-va

sheremet-va commented Aug 27, 2026

Copy link
Copy Markdown
Member

Doesn't seem like you've read the comments in the issue. Please don't waste maintainers time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maybe automated User is likely an AI agent, or the content was generated by an AI assistant without user control

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vitest reports a "PASS" even when some tests are still failing

2 participants