Skip to content

Commit 1ab8ca4

Browse files
committed
fix: resolve source
1 parent 2ab0adb commit 1ab8ca4

File tree

20 files changed

+56
-92
lines changed

20 files changed

+56
-92
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"**/node_modules": false
4343
},
4444
"[typescript]": {
45-
"editor.defaultFormatter": "biomejs.biome",
45+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4646
"editor.codeActionsOnSave": {
4747
"quickfix.biome": "explicit",
4848
"source.organizeImports": "never",

benchmark/bundle-diff/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"@modern-js/app-tools": "workspace:*",
2424
"@modern-js/tsconfig": "workspace:*",
2525
"@rsdoctor/rspack-plugin": "^1.3.11",
26-
"@types/jest": "^29.5.14",
2726
"@types/node": "^20",
2827
"@types/react": "^19.1.8",
2928
"@types/react-dom": "^19.1.6",

packages/cli/plugin-data-loader/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"new": "modern-lib new",
5151
"build": "rslib build",
5252
"dev": "rslib build --watch",
53-
"test": "jest --passWithNoTests"
53+
"test": "rstest --passWithNoTests"
5454
},
5555
"dependencies": {
5656
"@babel/core": "^7.28.5",
@@ -62,20 +62,17 @@
6262
"devDependencies": {
6363
"@modern-js/server-core": "workspace:*",
6464
"@modern-js/types": "workspace:*",
65-
"@scripts/jest-config": "workspace:*",
65+
"@scripts/rstest-config": "workspace:*",
6666
"@rslib/core": "0.18.0",
6767
"@modern-js/rslib": "workspace:*",
6868
"@types/babel__core": "^7.20.5",
69-
"@types/jest": "^29.5.14",
7069
"@types/node": "^20",
7170
"@types/supertest": "^2.0.16",
7271
"isomorphic-fetch": "^3.0.0",
73-
"jest": "^29.7.0",
7472
"memfs": "^3.5.3",
7573
"react": "^19.2.0",
7674
"react-dom": "^19.2.0",
7775
"supertest": "^6.3.4",
78-
"ts-jest": "^29.4.5",
7976
"typescript": "^5",
8077
"@rsbuild/core": "1.6.9"
8178
},
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { withTestPreset } from '@scripts/rstest-config';
2+
3+
export default withTestPreset({
4+
root: __dirname,
5+
testEnvironment: 'node',
6+
globals: true,
7+
tools: {
8+
swc: {
9+
jsc: {
10+
transform: {
11+
react: {
12+
runtime: 'automatic',
13+
},
14+
},
15+
},
16+
},
17+
},
18+
});

packages/cli/plugin-data-loader/tests/request.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/**
2-
* @jest-environment node
3-
*/
41
import { getRequestUrl } from '../src/cli/createRequest';
52
import { DIRECT_PARAM, LOADER_ID_PARAM } from '../src/common/constants';
63

packages/cli/plugin-data-loader/tests/server.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/**
2-
* @jest-environment node
3-
*/
41
import type { IncomingMessage, ServerResponse } from 'http';
52
import path from 'path';
63
import qs from 'querystring';
@@ -16,7 +13,7 @@ describe('handleRequest', () => {
1613
'./fixtures',
1714
'server',
1815
'bundles',
19-
'three-server-loaders',
16+
'three-server-loaders/index.js',
2017
);
2118
const createContext = (
2219
req: IncomingMessage,

packages/cli/plugin-data-loader/tests/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"esModuleInterop": true,
1010
"isolatedModules": true,
1111
"paths": {},
12-
"types": ["node", "jest"]
12+
"types": ["node", "@rstest/core/globals"]
1313
}
1414
}

packages/cli/plugin-ssg/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"new": "modern-lib new",
6565
"build": "rslib build",
6666
"dev": "rslib build --watch",
67-
"test": "jest --passWithNoTests"
67+
"test": "rstest --passWithNoTests"
6868
},
6969
"dependencies": {
7070
"@modern-js/prod-server": "workspace:*",
@@ -87,9 +87,7 @@
8787
"@scripts/rstest-config": "workspace:*",
8888
"@rslib/core": "0.18.0",
8989
"@modern-js/rslib": "workspace:*",
90-
"@types/jest": "^29.5.14",
9190
"@types/node": "^20",
92-
"jest": "^29.7.0",
9391
"react": "^19.2.0",
9492
"react-dom": "^19.2.0",
9593
"react-router-dom": "^7.6.0",

packages/generator/generator-common/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
"new": "modern-lib new",
3636
"build": "modern-lib build",
37-
"test": "jest --passWithNoTests"
37+
"test": "rstest --passWithNoTests"
3838
},
3939
"dependencies": {
4040
"@modern-js/codesmith-formily": "2.6.8",
@@ -46,10 +46,8 @@
4646
"@modern-js/codesmith-api-app": "2.6.8",
4747
"@modern-js/codesmith-utils": "2.6.8",
4848
"@scripts/build": "workspace:*",
49-
"@scripts/jest-config": "workspace:*",
50-
"@types/jest": "^29.5.14",
49+
"@scripts/rstest-config": "workspace:*",
5150
"@types/node": "^20",
52-
"jest": "^29.7.0",
5351
"typescript": "^5"
5452
},
5553
"sideEffects": false,
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { defineConfig } from '@rstest/core';
1+
import { withTestPreset } from '@scripts/rstest-config';
22

3-
export default defineConfig({
3+
export default withTestPreset({
4+
root: __dirname,
5+
testEnvironment: 'node',
46
globals: true,
57
});

0 commit comments

Comments
 (0)