Skip to content

Instantly share code, notes, and snippets.

@adohe-zz
Created March 13, 2014 09:13
Show Gist options
  • Select an option

  • Save adohe-zz/9524888 to your computer and use it in GitHub Desktop.

Select an option

Save adohe-zz/9524888 to your computer and use it in GitHub Desktop.
A common Makefile used in Node project
TESTS = test/*.test.js
REPORTER = spec
TIMEOUT = 10000
MOCHA_OPTS =
install-test:
@NODE_ENV=test npm install
test: install-test
@NODE_ENV=test ./node_modules/.bin/mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)
test-cov: install-test
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=html-cov | ./node_modules/.bin/cov
cov: test-cov
test-all: test test-cov
.PHONY: test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment