chore: upgrade Jest 30#10067
Open
snowystinger wants to merge 18 commits into
Open
Conversation
snowystinger
commented
May 14, 2026
|
|
||
| act(() => { | ||
| button.blur(); | ||
| outside.focus(); |
Member
Author
There was a problem hiding this comment.
I think this is more accurate to what the test said it was looking at. I included the other option below.
More info and links in the description
| */ | ||
|
|
||
| // needs to be imported first | ||
| import MatchMediaMock from 'jest-matchmedia-mock'; |
Member
Author
There was a problem hiding this comment.
jest-matchmedia-mock was really old and had a peer on jest 26 and hasn't been updated in years, so I've updated us to one that is more likely to keep up with new jest
| modality = 'virtual'; | ||
| } | ||
|
|
||
| if (modality === 'virtual' && typeof window !== 'undefined' && 'ontouchstart' in window) { |
Member
Author
There was a problem hiding this comment.
JSDOM now defines onTouchStart
| */ | ||
|
|
||
| // setup file | ||
| // oxlint-disable-next-line |
Member
Author
There was a problem hiding this comment.
doesn't appear when we run lint via the cli, but appears in the IDE
|
Build successful! 🎉 |
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.
Closes
Speeds:
for cold start
Jest 29 51.232 s
Jest 30 25.224 s
for warm start
Jest 29 32.115 s
Jest 30 25.871 s
Some things to note, jsdom stopped calling focus events when
blurwas called, this matches browsers. See https://github.com/jsdom/jsdom/pull/3767/changes so some of our tests needed updating. I attempted to keep with the spirit of the original test and added another for the ambiguity that I felt it had.There's another jsdom bug that doesn't update the style attribute cache. testing-library/jest-dom#673 so I changed a test to work around that.
jsdom also added ontouchstart and other window level handlers that we were relying on being absent for detection. Tests should now be more accurate by actually setting the pointer coarse media when appropriate.
majority of changes are from https://jestjs.io/docs/upgrading-to-jest30#jest-expect--matchers
Notable things to look forward to: https://github.com/jestjs/jest/blame/main/CHANGELOG.md
[@jest/fake-timers]AcceptTemporal.Durationinjest.advanceTimersByTime()andjest.advanceTimersByTimeAsync()(#16128)[@jest/fake-timers]AcceptTemporal.InstantandTemporal.ZonedDateTimeinjest.setSystemTime()anduseFakeTimers({now})(#16128)Temporal.Now.*✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: