Skip to content

Commit 1816f73

Browse files
committed
Fix failing coveralls script.
For PR's `process.env.COVERALLS_REPO_TOKEN` does not exist, so `tap` will not automatically send data to coveralls. Hence our existing script: `npm run coveralls`. Unfortuneately that seems to create problems to create problems when merged onto master. In that case `tap` **will** automatically push our coverage data, and the follow up push seems to fail. To fix all this, I check the environment variable in .travis.yaml, and manually push the coverage data if the environment variable does not exist. https://travis-ci.org/sindresorhus/ava/jobs/92855751
1 parent 4852c92 commit 1816f73

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ node_js:
33
- 'stable'
44
- '0.12'
55
- '0.10'
6-
after_success: npm run coveralls
6+
after_success:
7+
- '[ -z "$COVERALLS_REPO_TOKEN" ] && tap --coverage-report=text-lcov | ./node_modules/.bin/coveralls'

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"scripts": {
4040
"test": "xo && tap --coverage --reporter=spec --timeout=150 test/*.js",
4141
"test-win": "tap --reporter=spec --timeout=150 test/*.js",
42-
"coveralls": "tap --coverage-report=text-lcov | coveralls",
4342
"coverage": "tap --coverage-report=lcov"
4443
},
4544
"files": [

0 commit comments

Comments
 (0)