Skip to content
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

chore: update to Jest v29 #9895

Merged
merged 9 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
- shamsup
- shihanng
- shivamsinghchahar
- SimenB
- SkayuX
- souzasmatheus
- srmagura
Expand Down
15 changes: 5 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
"packages/react-router-dom-v5-compat",
"packages/react-router-native",
"packages/router"
],
"nohoist": [
"**/react-native",
"**/react-native/**"
]
},
"scripts": {
Expand Down Expand Up @@ -59,7 +55,7 @@
"@rollup/plugin-typescript": "^8.3.2",
"@testing-library/jest-dom": "5.16.3",
"@testing-library/react": "^13.3.0",
"@types/jest": "26.x",
"@types/jest": "29.x",
"@types/jsdom": "16.2.14",
"@types/jsonfile": "^6.0.1",
"@types/react": "^18.0.15",
Expand All @@ -71,7 +67,7 @@
"@typescript-eslint/parser": "^4.28.3",
"abort-controller": "^3.0.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.3",
"babel-jest": "^29.0.3",
"babel-plugin-dev-expression": "^0.2.2",
"chalk": "^4.1.1",
"cheerio": "^1.0.0-rc.10",
Expand All @@ -85,9 +81,9 @@
"eslint-plugin-react-hooks": "next",
"fs-extra": "^10.1.0",
"history": "^5.3.0",
"jest": "^26.6.3",
"jest": "^29.0.3",
"jest-environment-jsdom": "^29.0.3",
"jsonfile": "^6.1.0",
"metro-react-native-babel-preset": "^0.57.0",
"patch-package": "^6.4.7",
"prettier": "^2.5.1",
"prompt-confirm": "^2.0.4",
Expand All @@ -100,7 +96,6 @@
"rollup-plugin-prettier": "^2.2.2",
"rollup-plugin-terser": "^7.0.2",
"semver": "^7.3.5",
"ts-jest": "^26.5.6",
"type-fest": "^2.13.0",
"typescript": "^4.7.3"
},
Expand All @@ -121,7 +116,7 @@
"none": "11.5 kB"
},
"packages/react-router-dom/dist/umd/react-router-dom.production.min.js": {
"none": "17 kB"
"none": "17.5 kB"
}
}
}
8 changes: 8 additions & 0 deletions packages/react-router-dom-v5-compat/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
testEnvironment: "jsdom",
testMatch: ["**/__tests__/*-test.[jt]s?(x)"],
transform: {
"\\.[jt]sx?$": "./jest-transformer.js",
Expand All @@ -9,6 +10,13 @@ module.exports = {
setupFiles: ["./__tests__/setup.ts"],
moduleNameMapper: {
"^@remix-run/router$": "<rootDir>/../router/index.ts",
"^@remix-run/web-blob$": require.resolve("@remix-run/web-blob"),
Copy link

@SimenB SimenB Jan 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally you would provide CJS entry points for node browser and then we'd be able to avoid this. Right now there are both CJS and ESM entry points for node, but browser only has ESM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimenB I guess remix-run/web-std-io#43 is what you're referring to?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep 🙂

"^@remix-run/web-fetch$": require.resolve("@remix-run/web-fetch"),
"^@remix-run/web-form-data$": require.resolve("@remix-run/web-form-data"),
"^@remix-run/web-stream$": require.resolve("@remix-run/web-stream"),
"^@web3-storage/multipart-parser$": require.resolve(
"@web3-storage/multipart-parser"
),
"^react-router$": "<rootDir>/../react-router/index.ts",
"^react-router-dom-v5-compat$": "<rootDir>/index.ts",
},
Expand Down
19 changes: 0 additions & 19 deletions packages/react-router-dom/__tests__/custom-environment.js

This file was deleted.

Loading