Permalink
Browse files

Added test coverage support

  • Loading branch information...
1 parent b25fcbb commit 7063e386744a93521c1e1165851f3c4c541e0a8b @tj tj committed Feb 24, 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
@@ -2,3 +2,5 @@
lib-cov
testing
node_modules
+lib-cov
+coverage.html
View
@@ -2,3 +2,5 @@ test
support
benchmarks
examples
+lib-cov
+coverage.html
View
@@ -2,16 +2,24 @@
TESTS = test/*.js
SRC = $(shell find lib -name "*.js" -type f)
UGLIFY = $(shell find node_modules -name "uglifyjs" -type f)
-UGLIFY_FLAGS = --no-mangle
+UGLIFY_FLAGS = --no-mangle
+REPORTER = dot
all: jade.min.js runtime.min.js
test:
@./node_modules/.bin/mocha \
--ui exports \
--globals name \
+ --reporter $(REPORTER) \
$(TESTS)
+test-cov: lib-cov
+ JADE_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
+
+lib-cov:
+ jscoverage lib lib-cov
+
benchmark:
@node support/benchmark
@@ -37,4 +45,4 @@ clean:
rm -f runtime.js
rm -f runtime.min.js
-.PHONY: test benchmark clean
+.PHONY: test-cov test benchmark clean
View
@@ -1,2 +1,4 @@
-module.exports = require('./lib/jade');
+module.exports = process.env.JADE_COV
+ ? require('./lib-cov/jade')
+ : require('./lib/jade');

0 comments on commit 7063e38

Please sign in to comment.