mirror of
https://github.com/chaijs/chai
synced 2024-11-15 00:07:11 +00:00
mocha coverage support
This commit is contained in:
parent
0f64f8a5de
commit
38b0bcc2ea
3 changed files with 14 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -2,3 +2,5 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.swp
|
*.swp
|
||||||
|
coverage.html
|
||||||
|
lib-cov
|
||||||
|
|
11
Makefile
11
Makefile
|
@ -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
|
||||||
|
|
4
index.js
4
index.js
|
@ -1 +1,3 @@
|
||||||
module.exports = require('./lib/chai');
|
module.exports = process.env.CHAI_COV
|
||||||
|
? require('./lib-cov/chai')
|
||||||
|
: require('./lib/chai');
|
||||||
|
|
Loading…
Reference in a new issue