Skip to content

Instantly share code, notes, and snippets.

@stableShip
Last active April 1, 2016 01:12
Show Gist options
  • Save stableShip/93583af465a4d645ee45 to your computer and use it in GitHub Desktop.
Save stableShip/93583af465a4d645ee45 to your computer and use it in GitHub Desktop.
istanbul mocha的Makefile
TESTS = $(shell find test -type f -name "*.test.js")
REPORTER = spec
TIMEOUT = 80000
MOCHA_OPTS =
test:
@NODE_ENV=test /usr/local/bin/mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)
test-cov:
@rm -rf covera
@NODE_ENV=test /usr/local/bin/istanbul cover --report html /usr/local/bin/_mocha \
-- -R $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)
test-all: test test-cov
.PHONY: test-cov test test-all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment