Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

Adds vitest-fail-on-console to packages/react so tests fail when unexpected console.error or console.warn calls occur during CI. This catches React warnings and component bugs early.

Changes

Setup:

  • Install vitest-fail-on-console dev dependency
  • Configure in packages/react/config/vitest/browser/setup.ts (CI only)

Bug fixes discovered by new checks:

  • CircleBadge: Destructure inline, size, variant before spreading to DOM
  • Deprecated ActionList Group: Destructure groupId, showItemDividers before spreading
  • UnderlineNav: Filter leadingVisual/icon props from ActionList.LinkItem spread

Test updates:

  • implementsClassName utility now suppresses console during className-only tests
  • Tests expecting errors now mock console.error/console.warn before render
  • Tests with async act warnings use unmount() before mockRestore() to prevent late callbacks

Changelog

New

  • vitest-fail-on-console integration for CI test runs

Changed

  • CircleBadge no longer passes inline, size, variant props to DOM elements
  • ActionList.Group (deprecated) no longer passes groupId, showItemDividers to DOM elements
  • UnderlineNav no longer passes leadingVisual, icon through to DOM via overflow menu

Removed

N/A

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Run CI=true npx vitest to verify tests pass with fail-on-console enabled.

Merge checklist

Original prompt

Add vitest-fail-on-console to the project so that tests fail when a console.* call is triggered during CI. This should be added specifically to the setup for packages/react. Fix any failing tests and verify by running npx vitest


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@changeset-bot
Copy link

changeset-bot bot commented Dec 29, 2025

⚠️ No Changeset found

Latest commit: 9f2c14d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI and others added 3 commits December 29, 2025 18:43
- Install vitest-fail-on-console in packages/react
- Configure it in browser setup to run only in CI
- Update implementsClassName utility to suppress console calls
- Fix CircleBadge to not pass inline/size/variant to DOM
- Fix deprecated ActionList Group to not pass groupId to DOM
- Fix tests that expect errors to mock console.error first

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
- Add console.error mocks for tests expecting error throws
- Fix UnderlineNav to not pass leadingVisual/icon props to DOM
- Add mocks for act warnings in TreeView, Breadcrumbs, Pagination, Tabs tests

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
- Add unmount() calls before spy.mockRestore() to prevent late async callbacks
- Fixes TreeView and Pagination tests that had MutationObserver callbacks firing after cleanup

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Copilot AI changed the title [WIP] Add vitest-fail-on-console to react package setup Add vitest-fail-on-console to fail tests on console calls in CI Dec 29, 2025
Copilot AI requested a review from joshblack December 29, 2025 19:11
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Dec 29, 2025
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants