Skip to content

Commit

Permalink
minor: pre-commit, pre-push by husky
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeewhan committed Sep 20, 2024
1 parent bfccae4 commit fab34a6
Show file tree
Hide file tree
Showing 3 changed files with 517 additions and 485 deletions.
12 changes: 12 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

. "$HOME/.zshrc"

eval "$(fnm env)"

npm run test

if [ $? -ne 0 ]; then
echo "Test failed, aborting commit."
exit 1
fi
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@
"deploy:production": "npm run build && NODE_ENV=production sls deploy --stage production --verbose --region ap-northeast-2",
"push": "tsx src/push.ts",
"test": "vitest",
"coverage": "vitest run --coverage"
"coverage": "vitest run --coverage",
"prepare": "husky"
},
"husky": {
"hooks": {
"pre-commit": "npm run test",
"pre-push": "npm run type-check"
}
},
"engines": {
"yarn": "1.22.22"
},
"keywords": [],
"author": "",
Expand All @@ -27,8 +37,9 @@
"@faker-js/faker": "^9.0.1",
"@types/node": "^22.5.4",
"@vitest/coverage-v8": "^2.1.1",
"concurrently": "^8.2.0",
"concurrently": "^9.0.1",
"esbuild": "^0.19.0",
"husky": "^9.1.6",
"serverless-dotenv-plugin": "^6.0.0",
"serverless-offline": "^13.8.0",
"tsx": "^4.0.0",
Expand Down
Loading

0 comments on commit fab34a6

Please sign in to comment.