Skip to content

Commit 3fc3b25

Browse files
authored
Add pre-push hook check to block leftover .only()s (#1189)
1 parent cd95f68 commit 3fc3b25

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

extensions/ql-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@
11701170
"husky": {
11711171
"hooks": {
11721172
"pre-commit": "npm run format-staged",
1173-
"pre-push": "npm run lint"
1173+
"pre-push": "npm run lint && scripts/forbid-mocha-only"
11741174
}
11751175
},
11761176
"lint-staged": {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
if grep -rq --include '*.test.ts' 'it.only\|describe.only' './test' './src'; then
2+
echo 'There is a .only() in the tests. Please remove it.'
3+
exit 1;
4+
else
5+
exit 0;
6+
fi

0 commit comments

Comments
 (0)