-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade jest to v29 #21575
Upgrade jest to v29 #21575
Changes from all commits
676218c
1c81367
07ab585
dfcec60
86dac47
1ee8e96
125956e
a390ca0
5505b1f
a4a0276
a2a4f47
bc7a094
211024e
98118ee
229921e
e580909
6ec6eeb
67f776f
84286a8
0a7b29c
d8f4c8a
6bf603b
8d0a41d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -7,7 +7,7 @@ | |||||||||||||||||||
|
||||||||||||||||||||
'use strict'; | ||||||||||||||||||||
|
||||||||||||||||||||
describe('ReactDOMEventListener', () => { | ||||||||||||||||||||
describe('ReactDOMEventPropagation', () => { | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drive-by change. The suite name now matches the file name. |
||||||||||||||||||||
let React; | ||||||||||||||||||||
let OuterReactDOM; | ||||||||||||||||||||
let InnerReactDOM; | ||||||||||||||||||||
|
@@ -16,12 +16,12 @@ describe('ReactDOMEventListener', () => { | |||||||||||||||||||
beforeEach(() => { | ||||||||||||||||||||
window.TextEvent = function() {}; | ||||||||||||||||||||
jest.resetModules(); | ||||||||||||||||||||
React = require('react'); | ||||||||||||||||||||
jest.isolateModules(() => { | ||||||||||||||||||||
OuterReactDOM = require('react-dom'); | ||||||||||||||||||||
InnerReactDOM = require('react-dom'); | ||||||||||||||||||||
}); | ||||||||||||||||||||
jest.isolateModules(() => { | ||||||||||||||||||||
InnerReactDOM = require('react-dom'); | ||||||||||||||||||||
React = require('react'); | ||||||||||||||||||||
OuterReactDOM = require('react-dom'); | ||||||||||||||||||||
Comment on lines
-19
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably required due to jestjs/jest#10963. Though it's unclear why this test passed without this change using @SimenB Any idea if this is intended? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds odd that changing config impacts module loading. My only guess is react/scripts/jest/config.build.js Lines 38 to 46 in c1220eb
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The modules were all coming from the mapped paths. So ideally we'd have two isolated copies of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems you've worked around this, but a solution might be a new API which lets you selectively evict specific modules from the cache? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't thought about this for a while but if I remember correctly, I came to the conclusiong that the old code should never have worked to begin with. Not sure if it's worth revisiting since this testing pattern is very specific. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That sounds very reasonable 👍 It does sound like a weird edge case, but happy to revisit it if proves to actually guard against some regression 🙂 |
||||||||||||||||||||
}); | ||||||||||||||||||||
expect(OuterReactDOM).not.toBe(InnerReactDOM); | ||||||||||||||||||||
}); | ||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another example of jestjs/jest#6744