1 | TESTS = test/*.test.js
|
2 | REPORTER = tap
|
3 | TIMEOUT = 3000
|
4 | MOCHA_OPTS =
|
5 |
|
6 | install:
|
7 | @npm install --registry=http://registry.cnpmjs.org \
|
8 | --disturl=http://cnpmjs.org/dist
|
9 |
|
10 | test:
|
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 |
|
20 | test-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 |
|
31 | check-coverage:
|
32 | @./node_modules/.bin/istanbul check-coverage \
|
33 | --statements 95 \
|
34 | --functions 95 \
|
35 | --branches 85 \
|
36 | --lines 95
|
37 |
|
38 | cov:
|
39 | @./node_modules/.bin/cov coverage
|
40 |
|
41 | autod:
|
42 | @./node_modules/.bin/autod -w -e example.js
|
43 | @$(MAKE) install
|
44 |
|
45 | .PHONY: test
|