Skip to content

Commit cd1e0d0

Browse files
committed
feat(husky): Add pre-commit script to run tests and build
1 parent 350816a commit cd1e0d0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.husky/pre-commit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
echo "[Husky] pre-commit"
2+
npm run test -- --silent
3+
npm run build

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"test:integration": "npm run vitest -- --project integration --run",
2525
"test:watch": "npm run vitest",
2626
"test:coverage": "npm run vitest -- run --coverage",
27-
"test:ci": "npm run vitest -- run --silent --coverage --reporter=junit --outputFile.junit=./test-output/junit.xml"
27+
"test:ci": "npm run vitest -- run --silent --coverage --reporter=junit --outputFile.junit=./test-output/junit.xml",
28+
"prepare": "husky"
2829
},
2930
"bin": {
3031
"commitfy": "bin/cli.js",
@@ -46,6 +47,7 @@
4647
"@types/node": "^22.1.0",
4748
"@vitest/coverage-v8": "^2.0.5",
4849
"eslint": "^8.57.0",
50+
"husky": "^9.1.4",
4951
"tsup": "^8.2.4",
5052
"tsx": "^4.16.5",
5153
"typescript": "^5.5.4",

0 commit comments

Comments
 (0)