mocha coverage support

This commit is contained in:
Jake Luer 2012-02-24 02:59:52 -05:00
parent 0f64f8a5de
commit 38b0bcc2ea
3 changed files with 14 additions and 3 deletions

2
.gitignore vendored
View file

@ -2,3 +2,5 @@
node_modules/ node_modules/
.DS_Store .DS_Store
*.swp *.swp
coverage.html
lib-cov

View file

@ -9,7 +9,7 @@ chai.js: $(SRC)
@node support/compile $^ @node support/compile $^
clean: clean:
rm -f chai.js @rm -f chai.js
docs: clean-docs docs: clean-docs
@./node_modules/.bin/codex build \ @./node_modules/.bin/codex build \
@ -27,4 +27,11 @@ test:
--ui tdd \ --ui tdd \
$(TESTS) $(TESTS)
.PHONY: clean test docs clean-docs test-cov: lib-cov
@CHAI_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
lib-cov:
@rm -rf lib-cov
@jscoverage lib lib-cov
.PHONY: clean test docs clean-docs test-cov lib-cov

View file

@ -1 +1,3 @@
module.exports = require('./lib/chai'); module.exports = process.env.CHAI_COV
? require('./lib-cov/chai')
: require('./lib/chai');