Skip to content

Commit b88a215

Browse files
authored
chore(build): Add prepush script to run jest tests on push (#1297)
1 parent 5ea6b2b commit b88a215

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

build/prepush.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
prepush() {
4+
echo "--------------------------------------------------------"
5+
echo "Linting"
6+
echo "--------------------------------------------------------"
7+
yarn lint || exit 1
8+
9+
echo "--------------------------------------------------------"
10+
echo "Testing"
11+
echo "--------------------------------------------------------"
12+
git fetch upstream
13+
yarn test --changedSince=upstream/master || exit 1
14+
}
15+
16+
# Execute this script
17+
if ! prepush; then
18+
echo "----------------------------------------------------"
19+
echo "Error: failure in prepush script"
20+
echo "----------------------------------------------------"
21+
exit 1
22+
fi

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@
149149
],
150150
"husky": {
151151
"hooks": {
152+
"commit-msg": "commitlint -e",
152153
"pre-commit": "lint-staged",
153-
"pre-push": "yarn lint",
154-
"commit-msg": "commitlint -e"
154+
"pre-push": "./build/prepush.sh"
155155
}
156156
},
157157
"resolutions": {

0 commit comments

Comments
 (0)