test: stabilize watch failed reporter assertions - #10671
Open
macayu17 wants to merge 4 commits into
Open
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
sheremet-va
requested changes
Jul 29, 2026
|
|
||
| await vitest.waitForStdout('RERUN ../basic.test.js') | ||
| await vitest.waitForStdout('Waiting for file changes...') | ||
| const rerunOutput = vitest.stdout.slice(vitest.stdout.lastIndexOf('RERUN ../basic.test.js')) |
Member
There was a problem hiding this comment.
You can call vitest.resetOutput() before `waitForStdout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This keeps
test/e2e/test/watch/reporter-failed.test.tsfocused on the output from the current watch rerun.The test resets the captured output before editing a file, but watch output from the first run can still arrive around the rerun boundary. Slicing from the matching
RERUNline makes the assertions check the rerun result instead of any stale output already in the buffer.Refs #10618
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm buildpnpm --filter @vitest/test-e2e test watch/reporter-failed.test.tspnpm exec eslint test/e2e/test/watch/reporter-failed.test.ts --no-error-on-unmatched-patterngit diff --checkChangesets
feat:,fix:,perf:,docs:, orchore:.