Skip to content

Commit

Permalink
Replace code coverage tool 'blanket' to 'istanbul'
Browse files Browse the repository at this point in the history
  • Loading branch information
booxood committed May 10, 2016
1 parent c8422da commit 49c9d1a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ npm-debug.log
node_modules

coverage.html
coverage
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
language: node_js
node_js:
- "0.10"
- 0.10
- 0.12
- 4
- 5
script: "make test-travis"
after_script: "npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
30 changes: 21 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,37 @@ MOCHA_OPTS =
install:
@npm install

lint:
lint: install
@npm run lint

build:
@npm run build

test: install
test: install lint
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)

test-cov:
@rm -f coverage.html
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=html-cov > coverage.html
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=travis-cov
@ls -lh coverage.html
@NODE_ENV=test node \
./node_modules/.bin/istanbul cover \
./node_modules/mocha/bin/_mocha \
-- -u exports \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)

test-travis:
@NODE_ENV=test node \
./node_modules/.bin/istanbul cover \
./node_modules/mocha/bin/_mocha \
--report lcovonly \
-- -u exports \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)

test-all: lint build test test-cov
test-all: test test-cov

.PHONY: test test-cov test-all
.PHONY: test-cov test-travis test-all build
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@


[![Build Status](https://travis-ci.org/booxood/node-dota2-api.png?branch=master)](https://travis-ci.org/booxood/node-dota2-api)
[![Coverage Status](https://coveralls.io/repos/booxood/node-dota2-api/badge.svg)](https://coveralls.io/r/booxood/node-dota2-api)


**IMPORTANT: API is based on promises from v0.2.0**

Expand Down
9 changes: 1 addition & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@
"url": "https://github.com/booxood/node-dota2-api/issues"
},
"homepage": "https://github.com/booxood/node-dota2-api",
"config": {
"blanket": {
"pattern": "//^((?!(node_modules|test)).)*$/"
},
"travis-cov": {
"threshold": 90
}
},
"dependencies": {
"es6-object-assign": "^1.0.1",
"es6-promise": "^3.1.2",
Expand All @@ -51,6 +43,7 @@
"eslint-plugin-import": "^1.6.1",
"eslint-plugin-jsx-a11y": "^1.0.4",
"eslint-plugin-react": "^5.0.1",
"istanbul": "0.4.3",
"mocha": "^2.0.1",
"should": "^4.2.1",
"travis-cov": "^0.2.5"
Expand Down

0 comments on commit 49c9d1a

Please sign in to comment.