Skip to content

Commit

Permalink
chore(build): Add prepush script to run jest tests on push (#1297)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstoffan authored Nov 19, 2020
1 parent 5ea6b2b commit b88a215
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions build/prepush.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

prepush() {
echo "--------------------------------------------------------"
echo "Linting"
echo "--------------------------------------------------------"
yarn lint || exit 1

echo "--------------------------------------------------------"
echo "Testing"
echo "--------------------------------------------------------"
git fetch upstream
yarn test --changedSince=upstream/master || exit 1
}

# Execute this script
if ! prepush; then
echo "----------------------------------------------------"
echo "Error: failure in prepush script"
echo "----------------------------------------------------"
exit 1
fi
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@
],
"husky": {
"hooks": {
"commit-msg": "commitlint -e",
"pre-commit": "lint-staged",
"pre-push": "yarn lint",
"commit-msg": "commitlint -e"
"pre-push": "./build/prepush.sh"
}
},
"resolutions": {
Expand Down

0 comments on commit b88a215

Please sign in to comment.