Skip to content

test: stabilize watch failed reporter assertions - #10671

Open
macayu17 wants to merge 4 commits into
vitest-dev:mainfrom
macayu17:fix/10618-hooks-timeout
Open

test: stabilize watch failed reporter assertions#10671
macayu17 wants to merge 4 commits into
vitest-dev:mainfrom
macayu17:fix/10618-hooks-timeout

Conversation

@macayu17

Copy link
Copy Markdown
Contributor

Description

This keeps test/e2e/test/watch/reporter-failed.test.ts focused 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 RERUN line 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:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check [Allow edits by maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • pnpm build
  • pnpm --filter @vitest/test-e2e test watch/reporter-failed.test.ts
  • pnpm exec eslint test/e2e/test/watch/reporter-failed.test.ts --no-error-on-unmatched-pattern
  • git diff --check

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copilot AI review requested due to automatic review settings June 28, 2026 05:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@netlify

netlify Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

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


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'))

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.

You can call vitest.resetOutput() before `waitForStdout

@macayu17
macayu17 requested a review from sheremet-va July 29, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants