Merge pull request #237 from chaijs/coverage

Remove coveralls & generate coverage with istanbul
This commit is contained in:
Jake Luer 2014-01-26 12:03:48 -08:00
commit 54a8b1152a
6 changed files with 18 additions and 41 deletions

2
.gitignore vendored
View file

@ -16,7 +16,7 @@ components
node_modules
npm-debug.log
coverage.html
coverage
test/auth/*
!test/auth/.gitkeep

View file

@ -6,7 +6,7 @@ component.json
components/
build/
lib-cov/
coverage.html
coverage/
.travis.yml
.mailmap
Makefile

View file

@ -4,7 +4,7 @@ REPORTER = dot
#
# Browser Build
#
#
all: chai.js
@ -22,7 +22,7 @@ node_modules: package.json
#
# Components
#
#
build: components lib/*
@printf "==> [Component :: build]\n"
@ -34,7 +34,7 @@ components: node_modules component.json
#
# Tests
#
#
test: test-node test-phantom
@ -45,12 +45,10 @@ test-node: node_modules
--reporter $(REPORTER) \
$(TESTS)
test-cov: lib-cov
@CHAI_COV=1 NODE_ENV=test ./node_modules/.bin/mocha \
test-cov: node_modules
@NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- \
--require ./test/bootstrap \
--reporter html-cov \
$(TESTS) \
> coverage.html
test-phantom: build
@printf "==> [Test :: Karma (PhantomJS)]\n"
@ -62,30 +60,14 @@ test-sauce: build
@CHAI_TEST_ENV=sauce ./node_modules/karma/bin/karma start \
--single-run
test-coveralls: lib-cov
@CHAI_COV=1 NODE_ENV=test ./node_modules/.bin/mocha \
--require ./test/bootstrap \
--reporter mocha-lcov-reporter \
$(TESTS) \
| ./node_modules/coveralls/bin/coveralls.js
test-travisci: lib-cov
test-travisci:
@echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
@make test-node
@make test-coveralls
@make test-cov
@make test-sauce
#
# Coverage
#
lib-cov:
@rm -rf lib-cov
@./node_modules/jscoverage/bin/jscoverage lib lib-cov
#
# Clean up
#
#
clean: clean-node clean-browser clean-components clean-cov
@ -100,13 +82,12 @@ clean-components:
@rm -rf components
clean-cov:
@rm -rf lib-cov
@rm -f coverage.html
@rm -rf coverage
#
# Instructions
#
.PHONY: all
.PHONY: test test-all test-node test-phantom test-sauce test-cov test-coveralls
.PHONY: clean clean-node clean-browser clean-components clean-cov
.PHONY: all
.PHONY: test test-all test-node test-phantom test-sauce test-cov
.PHONY: clean clean-node clean-browser clean-components clean-cov

View file

@ -5,14 +5,14 @@ can be delightfully paired with any javascript testing framework.
For more information or to download plugins, view the [documentation](http://chaijs.com).
[![Build Status](https://travis-ci.org/chaijs/chai.png?branch=master)](https://travis-ci.org/chaijs/chai) [![Coverage Status](https://coveralls.io/repos/chaijs/chai/badge.png?branch=master)](https://coveralls.io/r/chaijs/chai?branch=master)
[![Build Status](https://travis-ci.org/chaijs/chai.png?branch=master)](https://travis-ci.org/chaijs/chai)
[![Selenium Test Status](https://saucelabs.com/browser-matrix/chaijs.svg)](https://saucelabs.com/u/chaijs)
### Related Projects
- [chaijs / assertion-error](https://github.com/chaijs/assertion-error): Custom `Error` constructor thrown upon an assertion failing.
- [chaijs / deep-eql](https://github.com/chaijs/deep-eql): Improved deep equality testing for Node.js and the browser.
- [chaijs / deep-eql](https://github.com/chaijs/deep-eql): Improved deep equality testing for Node.js and the browser.
### Contributors

View file

@ -32,12 +32,10 @@
},
"devDependencies": {
"component": "*"
, "coveralls": "2.0.16"
, "jscoverage": "0.3.7"
, "karma": "canary"
, "karma-mocha": "*"
, "karma-sauce-launcher": "git://github.com/embarkmobile/karma-sauce-launcher.git#feature-passfail"
, "mocha": "1.8.2"
, "mocha-lcov-reporter": "0.0.1"
, "istanbul": "~0.1.44"
}
}

View file

@ -2,9 +2,7 @@
* Attach chai to global
*/
global.chai = (process && process.env && process.env.CHAI_COV)
? require('../../lib-cov/chai')
: require('../..');
global.chai = require('../..');
/*!
* Provide check for fail function.