mirror of
https://github.com/facebook/react.git
synced 2026-02-26 07:55:55 +00:00
Upgrade jest and jsdom (#29026)
## Summary This brings: - jest* up from 29.4.2 -> 29.7.0 - jsdom up from 20.0.0 -> 22.1.0 While the latest version of jest-dom-environment still wants `jsdom@^20.0.0`, it can safely use at least up to `jsdom@22.1.0`. See https://github.com/jestjs/jest/pull/13825#issuecomment-1564015010 for details. Upgrading to latest versions lets us improve some WheelEvent tests and will make it possible to test a much simpler FormData construction approach (see #29018) ## How did you test this change? Ran `yarn test` and `yarn test --prod` successfully
This commit is contained in:
@@ -137,6 +137,7 @@
|
||||
"flags": "node ./scripts/flags/flags.js"
|
||||
},
|
||||
"resolutions": {
|
||||
"react-is": "npm:react-is"
|
||||
"react-is": "npm:react-is",
|
||||
"jsdom": "22.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4357,7 +4357,7 @@ describe('ReactDOMFizzServer', () => {
|
||||
pipe(writable);
|
||||
});
|
||||
expect(window.getComputedStyle(document.body).backgroundColor).toMatch(
|
||||
'blue',
|
||||
'rgb(0, 0, 255)',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -4386,7 +4386,7 @@ describe('ReactDOMFizzServer', () => {
|
||||
pipe(writable);
|
||||
});
|
||||
expect(window.getComputedStyle(document.body).backgroundColor).toMatch(
|
||||
'red',
|
||||
'rgb(255, 0, 0)',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -65,11 +65,8 @@ describe('SyntheticWheelEvent', () => {
|
||||
root.render(<div onWheel={onWheel} />);
|
||||
});
|
||||
|
||||
let event = new MouseEvent('wheel', {
|
||||
let event = new WheelEvent('wheel', {
|
||||
bubbles: true,
|
||||
});
|
||||
// jsdom doesn't support these so we add them manually.
|
||||
Object.assign(event, {
|
||||
deltaX: 10,
|
||||
deltaY: -50,
|
||||
});
|
||||
@@ -78,7 +75,7 @@ describe('SyntheticWheelEvent', () => {
|
||||
event = new MouseEvent('wheel', {
|
||||
bubbles: true,
|
||||
});
|
||||
// jsdom doesn't support these so we add them manually.
|
||||
// jsdom doesn't support these legacy Webkit properties so we add them manually.
|
||||
Object.assign(event, {
|
||||
wheelDeltaX: -10,
|
||||
wheelDeltaY: 50,
|
||||
@@ -106,7 +103,7 @@ describe('SyntheticWheelEvent', () => {
|
||||
});
|
||||
|
||||
container.firstChild.dispatchEvent(
|
||||
new MouseEvent('wheel', {
|
||||
new WheelEvent('wheel', {
|
||||
bubbles: true,
|
||||
deltaX: 10,
|
||||
deltaY: -50,
|
||||
@@ -114,7 +111,7 @@ describe('SyntheticWheelEvent', () => {
|
||||
);
|
||||
|
||||
container.firstChild.dispatchEvent(
|
||||
new MouseEvent('wheel', {
|
||||
new WheelEvent('wheel', {
|
||||
bubbles: true,
|
||||
deltaX: 10,
|
||||
deltaY: -50,
|
||||
|
||||
Reference in New Issue
Block a user