Skip to content

Commit a8f2165

Browse files
authored
Update to Jest 25 (#18480)
* Revert "Revert "Upgrade to jest 25 (#17896)" (#18376)" This reverts commit fc7835c. * Other fixes * Fix a broken test
1 parent c083a64 commit a8f2165

20 files changed

+1195
-1013
lines changed

fixtures/dom/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"classnames": "^2.2.5",
1212
"codemirror": "^5.40.0",
1313
"core-js": "^2.4.1",
14-
"jest-diff": "^24.8.0",
14+
"jest-diff": "^25.1.0",
1515
"prop-types": "^15.6.0",
1616
"query-string": "^4.2.3",
1717
"react": "^15.4.1",

fixtures/dom/yarn.lock

+87-62
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@
66
version "7.0.0"
77
resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.0.0.tgz#856446641620c1c5f0ca775621d478324ebd1f52"
88

9-
"@jest/types@^24.8.0":
10-
version "24.8.0"
11-
resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad"
12-
integrity sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==
9+
"@jest/types@^25.1.0":
10+
version "25.1.0"
11+
resolved "https://registry.yarnpkg.com/@jest/types/-/types-25.1.0.tgz#b26831916f0d7c381e11dbb5e103a72aed1b4395"
12+
integrity sha512-VpOtt7tCrgvamWZh1reVsGADujKigBUFTi19mlRjqEGsE8qH4r3s+skY33dNdXOwyZIvuftZ5tqdF1IgsMejMA==
1313
dependencies:
1414
"@types/istanbul-lib-coverage" "^2.0.0"
1515
"@types/istanbul-reports" "^1.1.1"
16-
"@types/yargs" "^12.0.9"
16+
"@types/yargs" "^15.0.0"
17+
chalk "^3.0.0"
18+
19+
"@types/color-name@^1.1.1":
20+
version "1.1.1"
21+
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
22+
integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==
1723

1824
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
1925
version "2.0.1"
@@ -35,10 +41,17 @@
3541
"@types/istanbul-lib-coverage" "*"
3642
"@types/istanbul-lib-report" "*"
3743

38-
"@types/yargs@^12.0.9":
39-
version "12.0.12"
40-
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916"
41-
integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==
44+
"@types/yargs-parser@*":
45+
version "15.0.0"
46+
resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d"
47+
integrity sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==
48+
49+
"@types/yargs@^15.0.0":
50+
version "15.0.1"
51+
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.1.tgz#9266a9d7be68cfcc982568211085a49a277f7c96"
52+
integrity sha512-sYlwNU7zYi6eZbMzFvG6eHD7VsEvFdoDtlD7eI1JTg7YNnuguzmiGsc6MPSq5l8n+h21AsNof0je+9sgOe4+dg==
53+
dependencies:
54+
"@types/yargs-parser" "*"
4255

4356
abab@^1.0.3:
4457
version "1.0.3"
@@ -174,10 +187,10 @@ ansi-regex@^3.0.0:
174187
version "3.0.0"
175188
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
176189

177-
ansi-regex@^4.0.0:
178-
version "4.1.0"
179-
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
180-
integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
190+
ansi-regex@^5.0.0:
191+
version "5.0.0"
192+
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
193+
integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
181194

182195
ansi-styles@^2.2.1:
183196
version "2.2.1"
@@ -189,12 +202,13 @@ ansi-styles@^3.0.0, ansi-styles@^3.1.0:
189202
dependencies:
190203
color-convert "^1.9.0"
191204

192-
ansi-styles@^3.2.0, ansi-styles@^3.2.1:
193-
version "3.2.1"
194-
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
195-
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
205+
ansi-styles@^4.0.0, ansi-styles@^4.1.0:
206+
version "4.2.1"
207+
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359"
208+
integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==
196209
dependencies:
197-
color-convert "^1.9.0"
210+
"@types/color-name" "^1.1.1"
211+
color-convert "^2.0.1"
198212

199213
anymatch@^1.3.0:
200214
version "1.3.0"
@@ -1507,14 +1521,13 @@ chalk@^2.0.0, chalk@^2.1.0:
15071521
escape-string-regexp "^1.0.5"
15081522
supports-color "^4.0.0"
15091523

1510-
chalk@^2.0.1:
1511-
version "2.4.2"
1512-
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
1513-
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
1524+
chalk@^3.0.0:
1525+
version "3.0.0"
1526+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4"
1527+
integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==
15141528
dependencies:
1515-
ansi-styles "^3.2.1"
1516-
escape-string-regexp "^1.0.5"
1517-
supports-color "^5.3.0"
1529+
ansi-styles "^4.1.0"
1530+
supports-color "^7.1.0"
15181531

15191532
chokidar@^1.6.0, chokidar@^1.7.0:
15201533
version "1.7.0"
@@ -1626,10 +1639,22 @@ color-convert@^1.9.0:
16261639
dependencies:
16271640
color-name "^1.1.1"
16281641

1642+
color-convert@^2.0.1:
1643+
version "2.0.1"
1644+
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
1645+
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
1646+
dependencies:
1647+
color-name "~1.1.4"
1648+
16291649
color-name@^1.0.0, color-name@^1.1.1:
16301650
version "1.1.1"
16311651
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689"
16321652

1653+
color-name@~1.1.4:
1654+
version "1.1.4"
1655+
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
1656+
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
1657+
16331658
color-string@^0.3.0:
16341659
version "0.3.0"
16351660
resolved "https://registry.yarnpkg.com/color-string/-/color-string-0.3.0.tgz#27d46fb67025c5c2fa25993bfbf579e47841b991"
@@ -2113,10 +2138,10 @@ [email protected]:
21132138
address "^1.0.1"
21142139
debug "^2.6.0"
21152140

2116-
diff-sequences@^24.3.0:
2117-
version "24.3.0"
2118-
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975"
2119-
integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw==
2141+
diff-sequences@^25.1.0:
2142+
version "25.1.0"
2143+
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-25.1.0.tgz#fd29a46f1c913fd66c22645dc75bffbe43051f32"
2144+
integrity sha512-nFIfVk5B/NStCsJ+zaPO4vYuLjlzQ6uFvPxzYyHlejNZ/UGa7G/n7peOXVrVNvRuyfstt+mZQYGpjxg9Z6N8Kw==
21202145

21212146
diff@^3.2.0:
21222147
version "3.3.0"
@@ -3180,10 +3205,10 @@ has-flag@^2.0.0:
31803205
version "2.0.0"
31813206
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51"
31823207

3183-
has-flag@^3.0.0:
3184-
version "3.0.0"
3185-
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
3186-
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
3208+
has-flag@^4.0.0:
3209+
version "4.0.0"
3210+
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
3211+
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
31873212

31883213
has-unicode@^2.0.0:
31893214
version "2.0.1"
@@ -3836,15 +3861,15 @@ jest-diff@^20.0.3:
38363861
jest-matcher-utils "^20.0.3"
38373862
pretty-format "^20.0.3"
38383863

3839-
jest-diff@^24.8.0:
3840-
version "24.8.0"
3841-
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172"
3842-
integrity sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g==
3864+
jest-diff@^25.1.0:
3865+
version "25.1.0"
3866+
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.1.0.tgz#58b827e63edea1bc80c1de952b80cec9ac50e1ad"
3867+
integrity sha512-nepXgajT+h017APJTreSieh4zCqnSHEJ1iT8HDlewu630lSJ4Kjjr9KNzm+kzGwwcpsDE6Snx1GJGzzsefaEHw==
38433868
dependencies:
3844-
chalk "^2.0.1"
3845-
diff-sequences "^24.3.0"
3846-
jest-get-type "^24.8.0"
3847-
pretty-format "^24.8.0"
3869+
chalk "^3.0.0"
3870+
diff-sequences "^25.1.0"
3871+
jest-get-type "^25.1.0"
3872+
pretty-format "^25.1.0"
38483873

38493874
jest-docblock@^20.0.3:
38503875
version "20.0.3"
@@ -3865,10 +3890,10 @@ jest-environment-node@^20.0.3:
38653890
jest-mock "^20.0.3"
38663891
jest-util "^20.0.3"
38673892

3868-
jest-get-type@^24.8.0:
3869-
version "24.8.0"
3870-
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc"
3871-
integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==
3893+
jest-get-type@^25.1.0:
3894+
version "25.1.0"
3895+
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-25.1.0.tgz#1cfe5fc34f148dc3a8a3b7275f6b9ce9e2e8a876"
3896+
integrity sha512-yWkBnT+5tMr8ANB6V+OjmrIJufHtCAqI5ic2H40v+tRqxDmE0PGnIiTyvRWFOMtmVHYpwRqyazDbTnhpjsGvLw==
38723897

38733898
jest-haste-map@^20.0.4:
38743899
version "20.0.5"
@@ -5335,15 +5360,15 @@ pretty-format@^20.0.3:
53355360
ansi-regex "^2.1.1"
53365361
ansi-styles "^3.0.0"
53375362

5338-
pretty-format@^24.8.0:
5339-
version "24.8.0"
5340-
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2"
5341-
integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==
5363+
pretty-format@^25.1.0:
5364+
version "25.1.0"
5365+
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.1.0.tgz#ed869bdaec1356fc5ae45de045e2c8ec7b07b0c8"
5366+
integrity sha512-46zLRSGLd02Rp+Lhad9zzuNZ+swunitn8zIpfD2B4OPCRLXbM87RJT2aBLBWYOznNUML/2l/ReMyWNC80PJBUQ==
53425367
dependencies:
5343-
"@jest/types" "^24.8.0"
5344-
ansi-regex "^4.0.0"
5345-
ansi-styles "^3.2.0"
5346-
react-is "^16.8.4"
5368+
"@jest/types" "^25.1.0"
5369+
ansi-regex "^5.0.0"
5370+
ansi-styles "^4.0.0"
5371+
react-is "^16.12.0"
53475372

53485373
private@^0.1.6:
53495374
version "0.1.6"
@@ -5531,10 +5556,10 @@ react-error-overlay@^1.0.10:
55315556
settle-promise "1.0.0"
55325557
source-map "0.5.6"
55335558

5534-
react-is@^16.8.4:
5535-
version "16.8.6"
5536-
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
5537-
integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==
5559+
react-is@^16.12.0:
5560+
version "16.12.0"
5561+
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
5562+
integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q==
55385563

55395564
react-scripts@^1.0.11:
55405565
version "1.0.11"
@@ -6354,12 +6379,12 @@ supports-color@^4.0.0, supports-color@^4.2.1:
63546379
dependencies:
63556380
has-flag "^2.0.0"
63566381

6357-
supports-color@^5.3.0:
6358-
version "5.5.0"
6359-
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
6360-
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
6382+
supports-color@^7.1.0:
6383+
version "7.1.0"
6384+
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1"
6385+
integrity sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==
63616386
dependencies:
6362-
has-flag "^3.0.0"
6387+
has-flag "^4.0.0"
63636388

63646389
svgo@^0.7.0:
63656390
version "0.7.1"

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
"google-closure-compiler": "^20200224.0.0",
6565
"gzip-size": "^5.1.1",
6666
"jasmine-check": "^1.0.0-rc.0",
67-
"jest": "^24.9.0",
68-
"jest-diff": "^24.9.0",
67+
"jest": "^25.2.7",
68+
"jest-diff": "^25.2.6",
6969
"jest-snapshot-serializer-raw": "^1.1.0",
7070
"minimatch": "^3.0.4",
7171
"minimist": "^1.2.0",

packages/jest-mock-scheduler/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"homepage": "https://reactjs.org/",
2121
"peerDependencies": {
22-
"jest": "^23.0.1 || ^24.0.0",
22+
"jest": "^23.0.1 || ^24.0.0 || ^25.1.0",
2323
"scheduler": "^0.15.0"
2424
},
2525
"files": [

packages/jest-react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"homepage": "https://reactjs.org/",
2121
"peerDependencies": {
22-
"jest": "^23.0.1 || ^24.0.0",
22+
"jest": "^23.0.1 || ^24.0.0 || ^25.1.0",
2323
"react": "^16.0.0",
2424
"react-test-renderer": "^16.0.0"
2525
},

packages/react-dom/src/__tests__/CSSPropertyOperations-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,13 @@ describe('CSSPropertyOperations', () => {
245245
it('should not add units to CSS custom properties', () => {
246246
class Comp extends React.Component {
247247
render() {
248-
return <div style={{'--foo': 5}} />;
248+
return <div style={{'--foo': '5'}} />;
249249
}
250250
}
251251

252252
const root = document.createElement('div');
253253
ReactDOM.render(<Comp />, root);
254254

255-
expect(root.children[0].style.Foo).toEqual('5');
255+
expect(root.children[0].style.getPropertyValue('--foo')).toEqual('5');
256256
});
257257
});

packages/react-dom/src/__tests__/ReactDOMComponent-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2376,7 +2376,7 @@ describe('ReactDOMComponent', () => {
23762376
const container = document.createElement('div');
23772377

23782378
ReactDOM.render(<img src={obj} />, container);
2379-
expect(container.firstChild.src).toBe('hello');
2379+
expect(container.firstChild.src).toBe('http://localhost/hello');
23802380

23812381
ReactDOM.render(<svg arabicForm={obj} />, container);
23822382
expect(container.firstChild.getAttribute('arabic-form')).toBe('hello');
@@ -2410,7 +2410,7 @@ describe('ReactDOMComponent', () => {
24102410
const child = Object.create(parent);
24112411
const el = ReactTestUtils.renderIntoDocument(<img src={child} />);
24122412

2413-
expect(el.src).toBe('hello.jpg');
2413+
expect(el.src).toBe('http://localhost/hello.jpg');
24142414
});
24152415

24162416
it('assigns ajaxify (an important internal FB attribute)', function() {

0 commit comments

Comments
 (0)