Repository navigation
fix(ui): fix html reporter crash when --bail cancels files - #11693
Merged
Merged
Conversation
Closes vitest-dev#11689 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
hi-ogawa
commented
Oct 22, 2026
| reporters: ['default', 'html'], | ||
| }, | ||
| ) | ||
| expect(result.stderr).toMatchInlineSnapshot(` |
Collaborator
Author
There was a problem hiding this comment.
Previously this failed by:
⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯
Error: Cannot find environment for <repo>/test/e2e/vitest-test-ffef203f-…/b-pass.test.ts
❯ getModuleGraphEnvironment ../../../packages/ui/dist/reporter.js:82:9
80| }
81| if (!environment) {
82| throw new Error(`Cannot find environment for ${testFilePath}`);
| ^
83| }
84| return environment;
❯ getSharedModuleGraphByEnvironment ../../../packages/ui/dist/reporter.js:68:23
❯ getSharedModuleGraphByProject ../../../packages/ui/dist/reporter.js:61:26
❯ serializeReportMetadata ../../../packages/ui/dist/reporter.js:232:16
❯ HTMLReporter.onTestRunEnd ../../../packages/ui/dist/reporter.js:160:24
❯ ../../../packages/vitest/dist/chunks/cli-api.BFK2VqI2.js:13664:56
❯ Vitest.report ../../../packages/vitest/dist/chunks/cli-api.BFK2VqI2.js:13664:36
❯ TestRun.end ../../../packages/vitest/dist/chunks/cli-api.BFK2VqI2.js:12142:21
❯ ../../../packages/vitest/dist/chunks/cli-api.BFK2VqI2.js:13242:26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hi-ogawa
marked this pull request as ready for review
October 22, 2026 02:05
sheremet-va
approved these changes
Oct 23, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
--bailcancels test files #11689When building the module graph, the HTML reporter assumed
TestModule.viteEnvironmentis always set. But that assumption is wrong for test files that never reached a worker, for example files that--bailcancels before they start. This PR fixes it by skipping those files, so they show up in the report with an empty module graph.Other places already handle this case, and only the HTML reporter missed it:
vitest/packages/vitest/src/node/core.ts
Lines 1116 to 1120 in 7a5c083
vitest/packages/ui/client/composables/client/static.ts
Lines 43 to 47 in 7a5c083