Skip to content

Commit

Permalink
Upgrade ts-jest
Browse files Browse the repository at this point in the history
  • Loading branch information
djhi committed Jun 21, 2023
1 parent d7824c0 commit 141de5b
Show file tree
Hide file tree
Showing 25 changed files with 2,634 additions and 2,708 deletions.
4 changes: 2 additions & 2 deletions examples/crm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/faker": "^5.1.7",
"@types/jest": "^26.0.19",
"@types/jest": "^29.5.2",
"@types/lodash": "~4.14.168",
"@types/react": "^17.0.20",
"@types/react-beautiful-dnd": "^13.0.0",
"@types/react-dom": "^17.0.9",
"@vitejs/plugin-react": "^2.2.0",
"source-map-explorer": "^2.0.0",
"typescript": "^5.0.4",
"typescript": "^5.1.3",
"vite": "^3.2.0",
"web-vitals": "^1.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/data-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"cross-env": "^5.2.0",
"ra-core": "^4.10.5",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"peerDependencies": {
"ra-core": "^4.0.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
},
"devDependencies": {
"@types/fetch-mock": "^7.3.2",
"@types/jest": "^26.0.19",
"@types/jest": "^29.5.2",
"@types/node": "^12.12.14",
"@types/prop-types": "^15.6.0",
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.9",
"@vitejs/plugin-react": "^2.2.0",
"rewire": "^5.0.0",
"source-map-explorer": "^2.0.0",
"typescript": "^5.0.4",
"typescript": "^5.1.3",
"vite": "^3.2.0"
}
}
2 changes: 1 addition & 1 deletion examples/no-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^2.2.0",
"typescript": "^5.0.4",
"typescript": "^5.1.3",
"vite": "^3.2.0"
},
"gitHead": "6eb0f6fcbe3ba237b507f3506d230b3445c0a764"
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@hookform/devtools": "^4.0.2",
"@vitejs/plugin-react": "^2.2.0",
"react-app-polyfill": "^1.0.4",
"typescript": "^5.0.4",
"typescript": "^5.1.3",
"vite": "^3.2.0"
}
}
2 changes: 1 addition & 1 deletion examples/tutorial/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/react": "^18.0.22",
"@types/react-dom": "^18.0.7",
"@vitejs/plugin-react": "^2.2.0",
"typescript": "^5.0.4",
"typescript": "^5.1.3",
"vite": "^3.2.0"
}
}
21 changes: 13 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ const fs = require('fs');

const packages = fs.readdirSync(path.resolve(__dirname, './packages'));
const moduleNameMapper = packages.reduce((mapper, dirName) => {
const package = require(path.resolve(
const pkg = require(path.resolve(
__dirname,
'./packages',
dirName,
'package.json'
));
mapper[`^${package.name}(.*)$`] = path.join(
mapper[`^${pkg.name}(.*)$`] = path.join(
__dirname,
`./packages/${dirName}/src$1`
);
Expand All @@ -19,20 +19,25 @@ const moduleNameMapper = packages.reduce((mapper, dirName) => {
module.exports = {
globalSetup: './test-global-setup.js',
setupFilesAfterEnv: ['./test-setup.js'],
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'jsdom',
testPathIgnorePatterns: [
'/node_modules/',
'/lib/',
'/esm/',
'/examples/simple/',
],
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|ts|tsx)$',
'[/\\\\]node_modules[/\\\\](?!(@hookform)/).+\\.(js|jsx|mjs|ts|tsx)$',
],
globals: {
'ts-jest': {
isolatedModules: true,
},
transform: {
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
'^.+\\.[tj]sx?$': [
'ts-jest',
{
isolatedModules: true,
useESM: true,
},
],
},
moduleNameMapper,
};
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@storybook/manager-webpack5": "^6.4.19",
"@storybook/react": "^6.4.19",
"@storybook/testing-react": "^1.2.4",
"@types/jest": "^26.0.19",
"@types/jest": "^29.5.2",
"@types/react": "^17.0.20",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
Expand All @@ -47,20 +47,22 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-testing-library": "^5.11.0",
"full-icu": "~1.3.1",
"global-jsdom": "^9.0.1",
"husky": "^2.3.0",
"jest": "26.6.0",
"jest-circus": "26.6.0",
"jest-resolve": "26.6.0",
"jest-watch-typeahead": "0.6.1",
"lerna": "~5.5.2",
"jest": "^29.5.0",
"jest-circus": "29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest-resolve": "29.5.0",
"jest-watch-typeahead": "2.2.2",
"lerna": "~7.0.2",
"lint-staged": "^13.0.3",
"lolex": "~2.3.2",
"prettier": "~2.1.1",
"raf": "~3.4.1",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"ts-jest": "^26.4.4",
"typescript": "^5.0.4",
"ts-jest": "^29.1.0",
"typescript": "^5.1.3",
"wait-on": "^3.2.0",
"webpack": "^5.70.0",
"whatwg-fetch": "^3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-react-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"devDependencies": {
"@types/react": ">=17.0.0",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"gitHead": "e936ff2c3f887d2e98ef136cf3b3f3d254725fc4"
}
4 changes: 2 additions & 2 deletions packages/ra-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@hookform/resolvers": "^2.8.8",
"@testing-library/react": "^11.2.3",
"@testing-library/react-hooks": "^7.0.2",
"@types/jest": "^26.0.19",
"@types/jest": "^29.5.2",
"@types/node": "^17.0.8",
"@types/node-polyglot": "^0.4.31",
"@types/react": "^17.0.20",
Expand All @@ -44,7 +44,7 @@
"react-router-dom": "^6.1.0",
"react-test-renderer": "^16.9.0 || ^17.0.0",
"rimraf": "^3.0.2",
"typescript": "^5.0.4",
"typescript": "^5.1.3",
"yup": "^0.32.11"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-data-fakerest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"cross-env": "^5.2.0",
"ra-core": "^4.10.5",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"peerDependencies": {
"ra-core": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-data-graphql-simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"cross-env": "^5.2.0",
"graphql": "^15.6.0",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"gitHead": "65189b7cea65cc57190f41f77b84fdb290b68e29"
}
2 changes: 1 addition & 1 deletion packages/ra-data-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"cross-env": "^5.2.0",
"graphql": "^15.6.0",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"gitHead": "65189b7cea65cc57190f41f77b84fdb290b68e29"
}
2 changes: 1 addition & 1 deletion packages/ra-data-json-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"cross-env": "^5.2.0",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"gitHead": "e936ff2c3f887d2e98ef136cf3b3f3d254725fc4"
}
2 changes: 1 addition & 1 deletion packages/ra-data-localforage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"devDependencies": {
"cross-env": "^5.2.0",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"peerDependencies": {
"ra-core": "*"
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-data-localstorage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"devDependencies": {
"cross-env": "^5.2.0",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"peerDependencies": {
"ra-core": "*"
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-data-simple-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"cross-env": "^5.2.0",
"ra-core": "^4.10.5",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"peerDependencies": {
"ra-core": "^4.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-i18n-polyglot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"cross-env": "^5.2.0",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"gitHead": "e936ff2c3f887d2e98ef136cf3b3f3d254725fc4"
}
2 changes: 1 addition & 1 deletion packages/ra-input-rich-text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"react-dom": "^17.0.0",
"react-hook-form": "^7.40.0",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"gitHead": "e936ff2c3f887d2e98ef136cf3b3f3d254725fc4"
}
2 changes: 1 addition & 1 deletion packages/ra-language-english/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"devDependencies": {
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"keywords": [
"react",
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-language-french/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"devDependencies": {
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"keywords": [
"react",
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-no-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"react-router": "^6.1.0",
"react-router-dom": "^6.1.0",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"peerDependencies": {
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"react-router-dom": "^6.1.0",
"react-test-renderer": "~16.8.6",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"peerDependencies": {
"@mui/icons-material": "^5.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"cross-env": "^5.2.0",
"expect": "^27.4.6",
"rimraf": "^3.0.2",
"typescript": "^5.0.4"
"typescript": "^5.1.3"
},
"peerDependencies": {
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
Expand Down
Loading

0 comments on commit 141de5b

Please sign in to comment.