Skip to content

Commit 04492d5

Browse files
committed
fix: use vitest
1 parent 86a6167 commit 04492d5

File tree

5 files changed

+406
-2236
lines changed

5 files changed

+406
-2236
lines changed

jest.config.js

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

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"clean": "rm -rf cjs esm lib build temp .cache",
4242
"prepublishOnly": "run-s test build",
4343
"start": "npm run clean && npm run build:esm -- --watch",
44-
"test": "jest",
44+
"test": "vitest",
4545
"demo": "ts-node -T ./src/bin/dpdm.ts ./example/index.js",
4646
"prepare": "husky install"
4747
},
@@ -52,17 +52,15 @@
5252
"license": "MIT",
5353
"devDependencies": {
5454
"@types/fs-extra": "^11.0.4",
55-
"@types/jest": "^30.0.0",
5655
"@types/yargs": "^17.0.35",
5756
"husky": "^9.1.7",
58-
"jest": "^30.2.0",
5957
"lint-staged": "^16.2.7",
6058
"npm-run-all": "^4.1.5",
6159
"prettier": "^3.8.1",
6260
"pretty-quick": "^4.2.2",
63-
"ts-jest": "^29.4.6",
6461
"ts-node": "^10.9.2",
65-
"tsx": "^4.21.0"
62+
"tsx": "^4.21.0",
63+
"vitest": "^4.0.18"
6664
},
6765
"dependencies": {
6866
"chalk": "^5.6.2",

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"allowUnreachableCode": false,
3737
"stripInternal": true,
3838
"allowUnusedLabels": false,
39-
"skipLibCheck": true
39+
"skipLibCheck": true,
40+
"types": ["vitest/globals"]
4041
},
4142
"include": ["./src/**/*.d.ts", "./src/**/*.ts", "./src/**/*.tsx"]
4243
}

vitest.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* @since 2026-01-30 16:44:23
3+
* @author acrazing <joking.young@gmail.com>
4+
*/
5+
6+
import { defineConfig } from 'vitest/config';
7+
8+
export default defineConfig({
9+
test: {
10+
globals: true,
11+
include: ['src/**/*.spec.ts'],
12+
},
13+
});

0 commit comments

Comments
 (0)