Permalink
Browse files

Added `make test-cov` support

  • Loading branch information...
1 parent a063302 commit 3b4aee3d26f57eb197bd5c9889430e9599957c10 @tj tj committed Feb 24, 2012
Showing with 14 additions and 2 deletions.
  1. +2 −0 .gitignore
  2. +2 −0 .npmignore
  3. +7 −1 Makefile
  4. +3 −1 index.js
View
2 .gitignore
@@ -1,3 +1,5 @@
+lib-cov
+coverage.html
.DS_Store
node_modules
*.sock
View
2 .npmignore
@@ -2,3 +2,5 @@ support
test
examples
*.sock
+lib-cov
+coverage.html
View
8 Makefile
@@ -14,6 +14,12 @@ test:
--growl \
$(TESTS)
+test-cov: lib-cov
+ SUPERAGENT_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
+
+lib-cov:
+ jscoverage lib lib-cov
+
superagent.js: $(SRC)
cat $^ > $@
@@ -33,4 +39,4 @@ test-docs:
clean:
rm -f superagent{,.min}.js
-.PHONY: test docs test-docs clean
+.PHONY: test-cov test docs test-docs clean
View
4 index.js
@@ -1,2 +1,4 @@
-module.exports = require('./lib/node');
+module.exports = process.env.SUPERAGENT_COV
+ ? require('./lib-cov/node')
+ : require('./lib/node');

0 comments on commit 3b4aee3

Please sign in to comment.