Skip to content

Commit 0c12cea

Browse files
committed
Travis checks the environment for unexpected changes before passing
1 parent f411203 commit 0c12cea

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language: node_js
33
node_js: 7
44

55
cache: yarn
6+
script: npm run test:travis
67

78
env:
89
global:

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"format": "prettier --single-quote --write \"{src,pages/src,pages/lib}/**/*.js\"",
3232
"testonly": "./resources/jest",
3333
"test": "run-s format build lint testonly type-check",
34+
"test:travis": "npm run test && ./resources/check-changes",
3435
"type-check": "cd type-definitions/tests && flow check",
3536
"perf": "node ./resources/bench.js",
3637
"start": "gulp --gulpfile gulpfile.js dev",

resources/check-changes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash -e
2+
3+
if ! git diff --quiet; then echo "
4+
5+
$(tput setf 4)The Travis build resulted in additional changed files.
6+
Typically this is due to not running $(tput smul)npm test$(tput rmul) locally before
7+
submitting a pull request.
8+
9+
The following changes were found:$(tput sgr0)
10+
";
11+
12+
git diff --exit-code;
13+
fi;

0 commit comments

Comments
 (0)