Skip to content

chore(deps-dev): bump the vitest group with 4 updates#7673

Merged
francinelucca merged 2 commits intodependabot/npm_and_yarn/vitest-d24016cca7from
copilot/sub-pr-7378
Mar 18, 2026
Merged

chore(deps-dev): bump the vitest group with 4 updates#7673
francinelucca merged 2 commits intodependabot/npm_and_yarn/vitest-d24016cca7from
copilot/sub-pr-7378

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 17, 2026

Bumps the vitest group with 4 packages: @vitest/browser, @vitest/browser-playwright, @vitest/eslint-plugin, and vitest (4.0.15 → 4.0.16).

CI Failure Analysis

The vitest 4.0.16 update exposed a pre-existing hang in src/TreeView/TreeView.test.tsx. The root cause was twofold:

  • vitest 4.0.16 restores the browser mode testTimeout to 15 seconds (PR #9167), after it was accidentally changed in a prior release.
  • perf(TreeView): defer scrollIntoView (perf(TreeView): defer scrollIntoView to coalesce reflows during rapid navigation #7545) introduced a requestAnimationFrame in the TreeView item focus handler. vi.useFakeTimers() was faking rAF, causing act() + userEvent interactions that focus a tree item to wait for a fake rAF that never fires — hanging indefinitely and timing out after 15 seconds. The remaining 39 failures cascaded from that first timeout.

Fix: Changed both vi.useFakeTimers() calls in TreeView.test.tsx to use { toFake: ['setTimeout', 'clearTimeout', 'setInterval', 'clearInterval', 'setImmediate', 'clearImmediate'] }, explicitly excluding requestAnimationFrame from faking. All existing vi.runAllTimers() calls for setTimeout-based behavior continue to work correctly. All 51 TreeView tests now pass in browser mode.

Changelog

New

Changed

  • src/TreeView/TreeView.test.tsx: Updated vi.useFakeTimers() calls to not fake requestAnimationFrame, fixing test hangs in vitest browser mode (Chromium)

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; dev-dependency bump + test fix only

Testing & Reviewing

All 51 TreeView browser-mode tests now pass. The fix is scoped entirely to the test file — no production code was changed.

Merge checklist


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 17, 2026

⚠️ No Changeset found

Latest commit: 511bab0

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 changed the title [WIP] Bump the vitest group with 4 updates chore(deps-dev): bump the vitest group with 4 updates Mar 17, 2026
Copilot AI requested a review from francinelucca March 17, 2026 18:24
@francinelucca
Copy link
Copy Markdown
Member

To unblock this PR, the TreeView browser-mode tests need to handle pending rAF callbacks (e.g., vi.useFakeTimers() + vi.runAllTimers() to flush rAF, or wrapping assertions in waitFor).

@copilot implement this

…ser tests

Co-authored-by: francinelucca <40550942+francinelucca@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 17, 2026

To unblock this PR, the TreeView browser-mode tests need to handle pending rAF callbacks (e.g., vi.useFakeTimers() + vi.runAllTimers() to flush rAF, or wrapping assertions in waitFor).

@copilot

Implemented in commit 511bab0.

The fix changes both vi.useFakeTimers() calls in the TreeView test file to use { toFake: [...] } with an explicit list that excludes requestAnimationFrame and cancelAnimationFrame. This leaves rAF as the real browser API while keeping setTimeout/setInterval/etc. fake (so existing vi.runAllTimers() calls still work).

Root cause: vi.useFakeTimers() was faking all timers including rAF. The perf(TreeView): defer scrollIntoView change (#7545) introduced a rAF in the onFocus handler. In vitest 4.0.16 browser mode (Chromium), when userEvent focuses a tree item, act() waits for the pending fake rAF — which never fires — causing the test to hang indefinitely and time out after 15 seconds.

All 51 TreeView tests now pass in browser mode.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 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. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@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 Mar 18, 2026
@francinelucca francinelucca added the skip changeset This change does not need a changelog label Mar 18, 2026
@francinelucca francinelucca marked this pull request as ready for review March 18, 2026 03:18
@francinelucca francinelucca requested a review from a team as a code owner March 18, 2026 03:18
@francinelucca francinelucca merged commit 2bdbc12 into dependabot/npm_and_yarn/vitest-d24016cca7 Mar 18, 2026
51 of 52 checks passed
@francinelucca francinelucca deleted the copilot/sub-pr-7378 branch March 18, 2026 03:18
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 skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants