Skip to content

Commit 8c7af6f

Browse files
committed
chore: 🤖 更新测试脚本和添加预提交钩子
1 parent 4d36d5b commit 8c7af6f

3 files changed

Lines changed: 4715 additions & 2 deletions

File tree

.husky/pre-commit

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
if [ "$SKIP_SIMPLE_GIT_HOOKS" = "1" ]; then
4+
echo "[INFO] SKIP_SIMPLE_GIT_HOOKS is set to 1, skipping hook."
5+
exit 0
6+
fi
7+
8+
if [ -f "$SIMPLE_GIT_HOOKS_RC" ]; then
9+
. "$SIMPLE_GIT_HOOKS_RC"
10+
fi
11+
12+
npm run type-check && npm test

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@
3939
"docs:build": "rspress build",
4040
"preview": "rspress preview",
4141
"docs:deploy": "gh-pages -d doc_build",
42-
"test": "vitest",
42+
"test": "vitest run --silent",
43+
"test:dev": "vitest",
4344
"test:coverage": "vitest run --coverage",
4445
"test:ui": "vitest --ui",
4546
"release": "pnpm build && bumpp --commit --push --tag && pnpm publish --no-git-checks",
46-
"postinstall": "simple-git-hooks",
47+
"prepare": "pnpm build && simple-git-hooks",
4748
"lint:package": "publint",
4849
"type-check": "tsc --noEmit"
4950
},

0 commit comments

Comments
 (0)