Skip to content

Instantly share code, notes, and snippets.

@hackerxian
Created December 14, 2015 14:30
Show Gist options
  • Save hackerxian/33f455e17aa700118298 to your computer and use it in GitHub Desktop.
Save hackerxian/33f455e17aa700118298 to your computer and use it in GitHub Desktop.
TESTS = $(shell ls -S `find test -type f -name "*.test.js" -print`)
REPORTER = spec
TIMEOUT = 10000
MOCHA_OPTS =
install:
@tnpm install
standard:
@node_modules/.bin/standard
standard-format:
@node_modules/.bin/standard \
--format
test: install
@NODE_ENV=test ./node_modules/.bin/mocha \
--require should \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)
test-cov cov: install
@-NODE_ENV=test node \
node_modules/.bin/istanbul cover --preserve-comments \
./node_modules/.bin/_mocha \
-- -u exports \
--require should \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)
@-./node_modules/.bin/alicov coverage
test-all: install test cov
autod: install
@./node_modules/.bin/autod -w --prefix="~" \
-D mocha,should,istanbul-harmony,alicov
@$(MAKE) install
.PHONY: test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment