test(vitest): enable console enforcement and document env override#7986
Conversation
|
|
b9480ad to
7f5f1bb
Compare
11c8e9e to
f7c1568
Compare
7f5f1bb to
c892bf8
Compare
f7c1568 to
101e921
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the Vitest project configurations across the monorepo to enable the shared @primer/vitest-config console enforcement by default, while still allowing local opt-out via VITEST_FAIL_ON_CONSOLE=false.
Changes:
- Flip the
__VITEST_FAIL_ON_CONSOLE__default from opt-in (=== 'true') to opt-out (!== 'false') across all Vitest project configs. - Apply the same behavior consistently for both node and browser Vitest projects.
Show a summary per file
| File | Description |
|---|---|
| packages/styled-react/vitest.config.ts | Enable fail-on-console by default for styled-react node tests. |
| packages/styled-react/vitest.config.browser.ts | Enable fail-on-console by default for styled-react browser tests. |
| packages/react/vitest.config.mts | Enable fail-on-console by default for react node tests. |
| packages/react/vitest.config.browser.mts | Enable fail-on-console by default for react browser tests. |
| packages/postcss-preset-primer/vitest.config.ts | Enable fail-on-console by default for postcss-preset-primer tests. |
| packages/doc-gen/vitest.config.mts | Enable fail-on-console by default for doc-gen tests. |
Copilot's findings
- Files reviewed: 6/6 changed files
- Comments generated: 0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c892bf8 to
6556f51
Compare
101e921 to
34287ea
Compare
|
@copilot can you add docs for this to agent instructions and contributor docs? Specifically the fail on console ENV helper |
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Done in I added docs for the fail-on-console ENV helper in:
Both now document that console enforcement is on by default and that |
Enables the shared Vitest console enforcement by default for every Vitest project, and documents the
VITEST_FAIL_ON_CONSOLE=falselocal debugging override in contributor docs and agent instructions.Changelog
New
Changed
contributor-docs/testing.md.github/copilot-instructions.mdRemoved
Rollout strategy
Testing & Reviewing
Validated with build, tests, type-check, lint, CSS lint, and format checks before the docs follow-up.
Validated docs follow-up with
npm run lintandnpm run format:diff.Merge checklist