Skip to content

Instantly share code, notes, and snippets.

@BoyCook

BoyCook/node_makefile

Last active Dec 11, 2015
Embed
What would you like to do?
Makefile for Node.js projects
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