Skip to content

Commit a3d9784

Browse files
authored
Merge pull request #20 from ribeirogab/feature/husky
feat(husky): Add pre-commit script to run tests and build
2 parents 350816a + 6e33cbe commit a3d9784

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

.github/workflows/pull-request.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ on:
77

88
jobs:
99
check:
10-
if: ${{ github.ref_name == 'main' }}
1110
uses: ./.github/workflows/check.yml

.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)