Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added `make test-cov`

  • Loading branch information...
commit aec4ea9b48d97fd060ada5bc2d5d29c76ba9227f 1 parent 15d626a
@tj authored
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
2  .gitignore
@@ -1,3 +1,5 @@
.DS_Store
node_modules
*.sock
+coverage.html
+lib-cov
View
2  .npmignore
@@ -2,3 +2,5 @@ support
test
examples
*.sock
+coverage.html
+lib-cov
View
12 Makefile
@@ -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
4 index.js
@@ -1,2 +1,4 @@
-module.exports = require('./lib/ejson');
+module.exports = process.env.EJSON_COV
+ ? require('./lib-cov/ejson')
+ : require('./lib/ejson');
Please sign in to comment.
Something went wrong with that request. Please try again.