Add vitest-fail-on-console to fail tests on console calls in CI #7384
+124
−27
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.
Adds
vitest-fail-on-consoleto packages/react so tests fail when unexpectedconsole.errororconsole.warncalls occur during CI. This catches React warnings and component bugs early.Changes
Setup:
vitest-fail-on-consoledev dependencypackages/react/config/vitest/browser/setup.ts(CI only)Bug fixes discovered by new checks:
CircleBadge: Destructureinline,size,variantbefore spreading to DOMDeprecated ActionList Group: DestructuregroupId,showItemDividersbefore spreadingUnderlineNav: FilterleadingVisual/iconprops from ActionList.LinkItem spreadTest updates:
implementsClassNameutility now suppresses console during className-only testsconsole.error/console.warnbefore renderunmount()beforemockRestore()to prevent late callbacksChangelog
New
vitest-fail-on-consoleintegration for CI test runsChanged
CircleBadgeno longer passesinline,size,variantprops to DOM elementsActionList.Group(deprecated) no longer passesgroupId,showItemDividersto DOM elementsUnderlineNavno longer passesleadingVisual,iconthrough to DOM via overflow menuRemoved
N/A
Rollout strategy
Testing & Reviewing
Run
CI=true npx vitestto verify tests pass with fail-on-console enabled.Merge checklist
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.