test(build-guards): make dist-gated skip explicit via WM_EXPECT_BUILT_OUTPUT - #6284
Merged
Conversation
…_OUTPUT
Two test files guard built output and disagreed on what to do when
dist/dashboard.html is missing. dashboard-eager-chunks.test.mjs silently
skipped every guard via { skip: !existsSync(dashboardHtml) } — a fail-open
that could let a regression ship if the build step stops producing the
artifact. dashboard-critical-css.test.mjs hard-failed with a clear message.
Fix: introduce WM_EXPECT_BUILT_OUTPUT env marker. Both files now:
- Skip when unset and artifact missing (local dev, no build)
- Fail with a descriptive error when set and artifact missing (CI)
- Run normally when artifact exists
CI exports WM_EXPECT_BUILT_OUTPUT=1 before npm run test:data (#6139).
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
Fixes #6139
Two test files guard built output and disagreed on what to do when
dist/dashboard.htmlis missing:tests/dashboard-eager-chunks.test.mjs{ skip: !existsSync(dashboardHtml) }— fail-openWM_EXPECT_BUILT_OUTPUT=1tests/dashboard-critical-css.test.mjsbuiltSrc()assertThe fix: introduce
WM_EXPECT_BUILT_OUTPUTenv marker. Both files now:CI exports
WM_EXPECT_BUILT_OUTPUT=1beforenpm run test:datain.github/workflows/test.yml.Verification:
WM_EXPECT_BUILT_OUTPUT=1+ no dist: suites fail withdist/dashboard.html is missing but WM_EXPECT_BUILT_OUTPUT=1