Skip to content

Commit eeb395f

Browse files
authored
test: migrate more tests to rstest (#7974)
1 parent 5bb8044 commit eeb395f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+356
-828
lines changed

packages/cli/plugin-data-loader/jest.config.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/runtime/render/jest.config.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/runtime/render/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"prepublishOnly": "only-allow-pnpm",
2525
"dev": "modern-lib build --watch",
2626
"build": "modern-lib build",
27-
"test": "jest --passWithNoTests"
27+
"test": "rstest --passWithNoTests"
2828
},
2929
"dependencies": {
3030
"@modern-js/types": "workspace:*",
@@ -36,10 +36,9 @@
3636
"@rslib/core": "0.18.3",
3737
"@modern-js/rslib": "workspace:*",
3838
"@modern-js/server-core": "workspace:*",
39-
"@types/jest": "^29.5.14",
39+
"@scripts/rstest-config": "workspace:*",
4040
"@types/react": "^19.1.8",
4141
"@types/react-dom": "^19.1.6",
42-
"jest": "^29.7.0",
4342
"react": "^19.2.1",
4443
"react-dom": "^19.2.1",
4544
"typescript": "^5"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { withTestPreset } from '@scripts/rstest-config';
2+
3+
export default withTestPreset({
4+
root: __dirname,
5+
testEnvironment: 'node',
6+
globals: true,
7+
});

packages/runtime/render/tests/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"declaration": false,
55
"baseUrl": "./",
66
"isolatedModules": true,
7-
"types": ["node", "jest"]
7+
"types": ["node", "@rstest/core/globals"]
88
}
99
}

packages/server/babel-plugin-module-resolver/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"prepublishOnly": "only-allow-pnpm",
3535
"dev": "modern-lib build --watch",
3636
"build": "modern-lib build",
37-
"test": "jest --passWithNoTests"
37+
"test": "rstest --passWithNoTests"
3838
},
3939
"dependencies": {
4040
"@swc/helpers": "^0.5.17",
@@ -49,9 +49,7 @@
4949
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
5050
"@babel/preset-env": "^7.28.5",
5151
"@scripts/build": "workspace:*",
52-
"@scripts/jest-config": "workspace:*",
53-
"common-tags": "^1.8.2",
54-
"jest": "^29.7.0"
52+
"common-tags": "^1.8.2"
5553
},
5654
"sideEffects": false,
5755
"publishConfig": {

packages/server/bff-runtime/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"prepublishOnly": "only-allow-pnpm",
3535
"dev": "rslib build --watch",
3636
"build": "rslib build",
37-
"test": "jest --passWithNoTests"
37+
"test": "rstest --passWithNoTests"
3838
},
3939
"dependencies": {
4040
"@swc/helpers": "^0.5.17",
@@ -43,11 +43,7 @@
4343
"farrow-schema": "^1.12.1"
4444
},
4545
"devDependencies": {
46-
"@scripts/jest-config": "workspace:*",
47-
"@types/jest": "^29.5.14",
4846
"@types/node": "^20",
49-
"jest": "^29.7.0",
50-
"ts-jest": "^29.4.6",
5147
"@rslib/core": "0.18.3",
5248
"@modern-js/rslib": "workspace:*",
5349
"typescript": "^5"

packages/server/core/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"exports": {
2424
".": {
2525
"types": "./dist/types/index.d.ts",
26+
"modern:source": "./src/index.ts",
2627
"jsnext:source": "./src/index.ts",
2728
"default": "./dist/cjs/index.js"
2829
},
@@ -55,7 +56,7 @@
5556
"prepublishOnly": "only-allow-pnpm",
5657
"dev": "rslib build --watch",
5758
"build": "rslib build",
58-
"test": "jest --passWithNoTests"
59+
"test": "rstest --passWithNoTests"
5960
},
6061
"engines": {
6162
"node": ">=20"
@@ -78,12 +79,9 @@
7879
"@scripts/rstest-config": "workspace:*",
7980
"@rslib/core": "0.18.3",
8081
"@types/cloneable-readable": "^2.0.3",
81-
"@types/jest": "^29.5.14",
8282
"@types/merge-deep": "^3.0.3",
8383
"@types/node": "^20",
8484
"http-proxy-middleware": "^2.0.9",
85-
"jest": "^29.7.0",
86-
"ts-jest": "^29.4.6",
8785
"@modern-js/rslib": "workspace:*",
8886
"typescript": "^5"
8987
},

packages/server/core/tests/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"jsx": "preserve",
66
"baseUrl": "./",
77
"isolatedModules": true,
8-
"types": ["node", "jest"],
8+
"types": ["node", "@rstest/core/globals"],
99
"outDir": "./dist",
1010
"paths": {
1111
"@base/*": ["../src/base/*"]

packages/server/core/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"jsx": "preserve",
77
"baseUrl": "./",
88
"isolatedModules": true,
9-
"types": ["node", "jest"]
9+
"types": ["node", "@rstest/core/globals"]
1010
},
1111
"include": ["src"]
1212
}

0 commit comments

Comments
 (0)