UNPKG

864 BPlain TextView Raw
1TESTS = test/*.test.js
2REPORTER = tap
3TIMEOUT = 3000
4MOCHA_OPTS =
5
6install:
7 @npm install --registry=http://registry.cnpmjs.org \
8 --disturl=http://cnpmjs.org/dist
9
10test:
11 @NODE_ENV=test ./node_modules/mocha/bin/mocha \
12 --harmony-generators \
13 --reporter $(REPORTER) \
14 --timeout $(TIMEOUT) \
15 --require should \
16 $(MOCHA_OPTS) \
17 $(TESTS)
18
19
20test-cov:
21 @NODE_ENV=test node --harmony \
22 node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha \
23 -- -u exports \
24 --reporter $(REPORTER) \
25 --timeout $(TIMEOUT) \
26 --require should \
27 $(MOCHA_OPTS) \
28 $(TESTS)
29 @-$(MAKE) check-coverage
30
31check-coverage:
32 @./node_modules/.bin/istanbul check-coverage \
33 --statements 95 \
34 --functions 95 \
35 --branches 85 \
36 --lines 95
37
38cov:
39 @./node_modules/.bin/cov coverage
40
41autod:
42 @./node_modules/.bin/autod -w -e example.js
43 @$(MAKE) install
44
45.PHONY: test