Skip to content

Commit

Permalink
Start testing on React 19
Browse files Browse the repository at this point in the history
  • Loading branch information
wwahammy committed Dec 14, 2024
1 parent d7c7eb5 commit cf68620
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 12 deletions.
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ switch(process.env.USE_REACT_VERSION) {
'^@testing-library/react((\\/.*)?)$': '@testing-library/react-12$1'
}
break;
case '18':
module.exports.cacheDirectory = '.cache/jest-cache-react-18'
module.exports.moduleNameMapper = {
...module.exports.moduleNameMapper,
'^react-is((\\/.*)?)$': 'react-is-18$1',
'^react-dom((\\/.*)?)$': 'react-dom-18$1',
'^react((\\/.*)?)$': 'react-18$1',
}
break;
default:
module.exports.moduleNameMapper = {
...module.exports.moduleNameMapper,
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
"scripts": {
"build": "rimraf dist && yarn webpack",
"test": "yarn build && yarn jest",
"jest": "yarn jest-on-react-18",
"jest": "yarn jest-on-react-19",
"jest-on-react-16": "USE_REACT_VERSION=16 jest",
"jest-on-react-17": "USE_REACT_VERSION=17 jest",
"jest-on-react-18": "USE_REACT_VERSION=18 jest",
"jest-on-react-19": "USE_REACT_VERSION=19 jest",
"webpack": "webpack",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
Expand Down Expand Up @@ -48,12 +49,14 @@
"babel-loader": "^9.0.1",
"jest": "^29",
"jest-environment-jsdom": "^29",
"react": "^18",
"react": "^19",
"react-16": "npm:react@^16",
"react-17": "npm:react@^17",
"react-dom": "^18",
"react-18": "npm:react@^18",
"react-dom": "^19",
"react-dom-16": "npm:react-dom@^16",
"react-dom-17": "npm:react-dom@^17",
"react-dom-18": "npm:react-dom@^18",
"react-is-16": "npm:react-is@^16",
"react-is-17": "npm:react-is@^17",
"react-use": ">=15.3.0",
Expand Down
45 changes: 36 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1615,12 +1615,14 @@ __metadata:
babel-loader: ^9.0.1
jest: ^29
jest-environment-jsdom: ^29
react: ^18
react: ^19
react-16: "npm:react@^16"
react-17: "npm:react@^17"
react-dom: ^18
react-18: "npm:react@^18"
react-dom: ^19
react-dom-16: "npm:react-dom@^16"
react-dom-17: "npm:react-dom@^17"
react-dom-18: "npm:react-dom@^18"
react-is-16: "npm:react-is@^16"
react-is-17: "npm:react-is@^17"
react-use: ">=15.3.0"
Expand Down Expand Up @@ -6909,6 +6911,15 @@ __metadata:
languageName: node
linkType: hard

"react-18@npm:react@^18":
version: 18.2.0
resolution: "react@npm:18.2.0"
dependencies:
loose-envify: ^1.1.0
checksum: 88e38092da8839b830cda6feef2e8505dec8ace60579e46aa5490fc3dc9bba0bd50336507dc166f43e3afc1c42939c09fe33b25fae889d6f402721dcd78fca1b
languageName: node
linkType: hard

"react-docgen-typescript@npm:^2.2.2":
version: 2.2.2
resolution: "react-docgen-typescript@npm:2.2.2"
Expand Down Expand Up @@ -6963,7 +6974,7 @@ __metadata:
languageName: node
linkType: hard

"react-dom@npm:^18":
"react-dom-18@npm:react-dom@^18":
version: 18.2.0
resolution: "react-dom@npm:18.2.0"
dependencies:
Expand All @@ -6975,6 +6986,17 @@ __metadata:
languageName: node
linkType: hard

"react-dom@npm:^19":
version: 19.0.0
resolution: "react-dom@npm:19.0.0"
dependencies:
scheduler: ^0.25.0
peerDependencies:
react: ^19.0.0
checksum: 009cc6e575263a0d1906f9dd4aa6532d2d3d0d71e4c2b7777c8fe4de585fa06b5b77cdc2e0fbaa2f3a4a5e5d3305c189ba152153f358ee7da4d9d9ba5d3a8975
languageName: node
linkType: hard

"react-error-boundary@npm:^3.1.0":
version: 3.1.3
resolution: "react-error-boundary@npm:3.1.3"
Expand Down Expand Up @@ -7049,12 +7071,10 @@ __metadata:
languageName: node
linkType: hard

"react@npm:^18":
version: 18.2.0
resolution: "react@npm:18.2.0"
dependencies:
loose-envify: ^1.1.0
checksum: 88e38092da8839b830cda6feef2e8505dec8ace60579e46aa5490fc3dc9bba0bd50336507dc166f43e3afc1c42939c09fe33b25fae889d6f402721dcd78fca1b
"react@npm:^19":
version: 19.0.0
resolution: "react@npm:19.0.0"
checksum: 86de15d85b2465feb40297a90319c325cb07cf27191a361d47bcfe8c6126c973d660125aa67b8f4cbbe39f15a2f32efd0c814e98196d8e5b68c567ba40a399c6
languageName: node
linkType: hard

Expand Down Expand Up @@ -7444,6 +7464,13 @@ __metadata:
languageName: node
linkType: hard

"scheduler@npm:^0.25.0":
version: 0.25.0
resolution: "scheduler@npm:0.25.0"
checksum: b7bb9fddbf743e521e9aaa5198a03ae823f5e104ebee0cb9ec625392bb7da0baa1c28ab29cee4b1e407a94e76acc6eee91eeb749614f91f853efda2613531566
languageName: node
linkType: hard

"schema-utils@npm:^3.1.1, schema-utils@npm:^3.2.0":
version: 3.3.0
resolution: "schema-utils@npm:3.3.0"
Expand Down

0 comments on commit cf68620

Please sign in to comment.