Skip to content

Commit 951defe

Browse files
committed
test(jest): upgrade jest to v29
1 parent e3a743c commit 951defe

7 files changed

+834
-1262
lines changed

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@rollup/plugin-replace": "^2.3.0",
5252
"@types/fs-extra": "^8.0.1",
5353
"@types/glob-parent": "^5.1.0",
54-
"@types/jest": "^26.0.10",
54+
"@types/jest": "^29.0.3",
5555
"@types/node": "^13.7.1",
5656
"@types/react": "^17.0.49",
5757
"@types/react-dom": "^17.0.17",
@@ -73,15 +73,16 @@
7373
"eslint-plugin-react-hooks": "^4.6.0",
7474
"fs-extra": "^8.1.0",
7575
"glob-parent": "^5.1.0",
76-
"jest": "^27.0.4",
76+
"jest": "^29.0.3",
77+
"jest-environment-jsdom": "^29.0.3",
7778
"jsdoc-tests": "^0.1.0",
7879
"lerna": "^5.5.1",
7980
"mobx": "^5.15.4",
8081
"prettier": "^2.1.0",
8182
"rimraf": "^3.0.2",
8283
"rollup": "^1.28.0",
8384
"rollup-plugin-terser": "^7.0.0",
84-
"ts-jest": "^27.1.3",
85+
"ts-jest": "^29.0.1",
8586
"ts-node": "^10.9.1",
8687
"tslib": "^2.3.1",
8788
"typedoc": "^0.23.11",

scripts/jest/dev.config.json

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"globals": {
66
"__DEV__": true
77
},
8+
"transform": {
9+
"^.+\\.tsx?$": "ts-jest"
10+
},
811
"testPathIgnorePatterns": [
912
"examples",
1013
"packages/reactant-cli/templates",

scripts/jest/prod.config.json

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"globals": {
66
"__DEV__": false
77
},
8+
"transform": {
9+
"^.+\\.tsx?$": "ts-jest"
10+
},
811
"testPathIgnorePatterns": [
912
"examples",
1013
"packages/reactant-cli/templates",

scripts/jest/useDefineForClassFields.config.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
"testEnvironment": "jsdom",
44
"rootDir": "../../",
55
"globals": {
6-
"__DEV__": true,
7-
"ts-jest": {
8-
"tsconfig": {
6+
"__DEV__": true
7+
},
8+
"transform": {
9+
"^.+\\.tsx?$": [
10+
"ts-jest",
11+
{
912
"useDefineForClassFields": true
1013
}
11-
}
14+
]
1215
},
1316
"testPathIgnorePatterns": [
1417
"examples",

scripts/jest/useES2015.config.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
"testEnvironment": "jsdom",
44
"rootDir": "../../",
55
"globals": {
6-
"__DEV__": true,
7-
"ts-jest": {
8-
"tsconfig": {
6+
"__DEV__": true
7+
},
8+
"transform": {
9+
"^.+\\.tsx?$": [
10+
"ts-jest",
11+
{
912
"target": "ES2015"
1013
}
11-
}
14+
]
1215
},
1316
"testMatch": ["**/?(*.)+(es2015).[jt]s?(x)"],
1417
"testPathIgnorePatterns": [

scripts/typescript.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import chalk from 'chalk';
77
import { array } from 'yargs';
88
import { handleWorkspaces, Package } from './workspaces';
99

10-
const projects = array('p').argv.p;
10+
const { p: projects } = array('p').argv as { p: string[] };
1111

1212
type CompileOption = {
1313
currentPath: string;
@@ -58,7 +58,7 @@ const compileTypeScript = ({
5858
if (result.emitSkipped) {
5959
const message = result.diagnostics
6060
.map(
61-
diagnostic =>
61+
(diagnostic) =>
6262
`${ts.DiagnosticCategory[diagnostic.category]} ${diagnostic.code} (${
6363
diagnostic.file
6464
}:${diagnostic.start}): ${diagnostic.messageText}`

0 commit comments

Comments
 (0)