Skip to content

Commit 8eab05d

Browse files
committed
feat: upgrade some deps and replace test deps
1 parent 8ca006b commit 8eab05d

File tree

3 files changed

+41
-17
lines changed

3 files changed

+41
-17
lines changed

jest.config.ts

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

package.json

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
"compile": "father-build",
3939
"deploy": "npm run docs:build && npm run docs:deploy",
4040
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
41-
"test": "father test",
42-
"test:coverage": "umi-test --coverage",
41+
"test": "vitest --watch=false",
42+
"test:watch": "vitest --ui --changed",
43+
"test:coverage": "vitest run --coverage",
4344
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
4445
"lint": "eslint src/ --ext .tsx,.ts",
4546
"lint:tsc": "tsc -p tsconfig.json --noEmit",
@@ -56,20 +57,20 @@
5657
},
5758
"devDependencies": {
5859
"@testing-library/jest-dom": "^5.16.4",
59-
"@testing-library/react": "^12.1.5",
60-
"@types/enzyme": "^3.10.5",
60+
"@testing-library/react": "14.0.0",
61+
"@testing-library/react-hooks": "^8.0.1",
62+
"@testing-library/user-event": "^14.4.3",
6163
"@types/jest": "^29.2.5",
6264
"@types/lodash": "^4.14.135",
6365
"@types/react": "^18.0.0",
6466
"@types/react-dom": "^18.0.0",
6567
"@umijs/fabric": "^2.5.2",
66-
"@umijs/test": "^3.2.27",
68+
"@umijs/test": "4.0.61",
69+
"@vitejs/plugin-react": "^3.1.0",
70+
"@vitest/ui": "^0.29.3",
6771
"dumi": "^1.1.0",
68-
"enzyme": "^3.1.0",
69-
"enzyme-adapter-react-16": "^1.0.2",
70-
"enzyme-to-json": "^3.1.4",
7172
"eslint": "^7.18.0",
72-
"father": "^2.13.6",
73+
"father": "4.1.7",
7374
"father-build": "^1.18.6",
7475
"gh-pages": "^3.1.0",
7576
"jest": "^29.3.1",
@@ -81,6 +82,9 @@
8182
"react-dom": "18.2.0",
8283
"react-redux": "^4.4.10",
8384
"redux": "^3.7.2",
84-
"typescript": "^4.6.3"
85+
"ts-node": "^10.9.1",
86+
"typescript": "5.0.2",
87+
"vite": "^4.2.0",
88+
"vitest": "^0.29.3"
8589
}
8690
}

vite.config.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/// <reference types="vitest" />
2+
3+
import react from '@vitejs/plugin-react';
4+
import { defineConfig } from 'vitest/config';
5+
6+
// https://vitejs.dev/config/
7+
export default defineConfig({
8+
plugins: [react()],
9+
css: {
10+
preprocessorOptions: {
11+
less: {
12+
javascriptEnabled: true,
13+
modifyVars: {
14+
'root-entry-name': 'variable',
15+
},
16+
},
17+
},
18+
},
19+
test: {
20+
globals: true,
21+
environment: 'jsdom',
22+
setupFiles: './tests/setupAfterEnv.ts',
23+
css: true,
24+
reporters: ['default', 'junit'],
25+
outputFile: './coverage/test-results.xml',
26+
},
27+
});

0 commit comments

Comments
 (0)