Last active
December 11, 2015 13:18
-
-
Save BoyCook/4606004 to your computer and use it in GitHub Desktop.
Makefile for Node.js projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TESTS = test/spec | |
REPORTER = spec | |
XML_FILE = reports/TEST-all.xml | |
HTML_FILE = reports/coverage.html | |
test: test-mocha | |
test-ci: | |
$(MAKE) test-mocha REPORTER=xUnit > $(XML_FILE) | |
test-all: clean test-ci test-cov | |
test-mocha: | |
@NODE_ENV=test mocha \ | |
--timeout 200 \ | |
--reporter $(REPORTER) \ | |
$(TESTS) | |
test-cov: lib-cov | |
@APP_COVERAGE=1 $(MAKE) test-mocha REPORTER=html-cov > $(HTML_FILE) | |
lib-cov: | |
jscoverage lib lib-cov | |
clean: | |
rm -f reports/* | |
rm -fr lib-cov |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment