Skip to content

Commit 61a6d97

Browse files
fengmk2claude
andcommitted
test: add unit tests with vitest
- Add vitest configuration - Add tests for types (Zod schemas validation) - Add tests for inputs (parsing and validation) - Add tests for utils (lock file detection) - Update CI workflow to run unit tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8e6f2e1 commit 61a6d97

7 files changed

Lines changed: 1289 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ jobs:
7777
- name: Type check
7878
run: pnpm run typecheck
7979

80+
- name: Unit tests
81+
run: pnpm test
82+
8083
- name: Build
8184
run: pnpm run build
8285

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"packageManager": "pnpm@10.28.0",
77
"scripts": {
88
"build": "tsdown",
9-
"typecheck": "tsc --noEmit"
9+
"typecheck": "tsc --noEmit",
10+
"test": "vitest run",
11+
"test:watch": "vitest"
1012
},
1113
"dependencies": {
1214
"@actions/cache": "^4.0.0",
@@ -19,6 +21,7 @@
1921
"devDependencies": {
2022
"@types/node": "^22.0.0",
2123
"tsdown": "latest",
22-
"typescript": "^5.7.0"
24+
"typescript": "^5.7.0",
25+
"vitest": "^4.0.17"
2326
}
2427
}

0 commit comments

Comments
 (0)