Add pre-push hook check to block leftover .only()s (#1189)

This commit is contained in:
Charis Kyriakou
2022-03-08 09:32:18 +00:00
committed by GitHub
parent cd95f68692
commit 3fc3b259ba
2 changed files with 7 additions and 1 deletions

View File

@@ -1170,7 +1170,7 @@
"husky": {
"hooks": {
"pre-commit": "npm run format-staged",
"pre-push": "npm run lint"
"pre-push": "npm run lint && scripts/forbid-mocha-only"
}
},
"lint-staged": {

View File

@@ -0,0 +1,6 @@
if grep -rq --include '*.test.ts' 'it.only\|describe.only' './test' './src'; then
echo 'There is a .only() in the tests. Please remove it.'
exit 1;
else
exit 0;
fi