diff --git a/.gitignore b/.gitignore index e2d066a..2be5a51 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ npm-debug.log node_modules coverage.html +coverage \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 6e5919d..99db08d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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" diff --git a/Makefile b/Makefile index f6c059a..5fb6cf1 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 901dc0e..a84ade9 100644 --- a/README.md +++ b/README.md @@ -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** diff --git a/package.json b/package.json index 7bb32ab..a03918b 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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"