Permalink
Browse files

Added `make test-cov`

  • Loading branch information...
1 parent 15d626a commit aec4ea9b48d97fd060ada5bc2d5d29c76ba9227f @tj committed Mar 21, 2012
Showing with 17 additions and 3 deletions.
  1. +2 −0 .gitignore
  2. +2 −0 .npmignore
  3. +10 −2 Makefile
  4. +3 −1 index.js
View
@@ -1,3 +1,5 @@
.DS_Store
node_modules
*.sock
+coverage.html
+lib-cov
View
@@ -2,3 +2,5 @@ support
test
examples
*.sock
+coverage.html
+lib-cov
View
@@ -1,7 +1,15 @@
+REPORTER=spec
+
test:
@./node_modules/.bin/mocha \
--require should \
- --reporter spec
+ --reporter $(REPORTER)
+
+test-cov: lib-cov
+ EJSON_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
+
+lib-cov: lib
+ jscoverage $< $@
-.PHONY: test
+.PHONY: test test-cov
View
@@ -1,2 +1,4 @@
-module.exports = require('./lib/ejson');
+module.exports = process.env.EJSON_COV
+ ? require('./lib-cov/ejson')
+ : require('./lib/ejson');

0 comments on commit aec4ea9

Please sign in to comment.