1 |
|
2 | NODETESTS ?= test/*.js test/node/*.js
|
3 | BROWSERTESTS ?= test/*.js test/client/*.js
|
4 | REPORTER = spec
|
5 |
|
6 | test:
|
7 | @if [ "x$(BROWSER)" = "x" ]; then make test-node; else make test-browser; fi
|
8 |
|
9 | test-node:
|
10 | @NODE_ENV=test ./node_modules/.bin/mocha \
|
11 | --require should \
|
12 | --trace-warnings \
|
13 | --throw-deprecation \
|
14 | --reporter $(REPORTER) \
|
15 | --timeout 5000 \
|
16 | $(NODETESTS)
|
17 |
|
18 | test-node-http2:
|
19 | @NODE_ENV=test HTTP2_TEST=1 node ./node_modules/.bin/mocha \
|
20 | --require should \
|
21 | --trace-warnings \
|
22 | --throw-deprecation \
|
23 | --reporter $(REPORTER) \
|
24 | --timeout 5000 \
|
25 | $(NODETESTS)
|
26 |
|
27 | test-cov: lib-cov
|
28 | SUPERAGENT_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
|
29 |
|
30 | test-browser:
|
31 | SAUCE_APPIUM_VERSION=1.7 ./node_modules/.bin/zuul -- $(BROWSERTESTS)
|
32 |
|
33 | test-browser-local:
|
34 | ./node_modules/.bin/zuul --no-coverage --local 4000 -- $(BROWSERTESTS)
|
35 |
|
36 | lib-cov:
|
37 | jscoverage lib lib-cov
|
38 |
|
39 | test-server:
|
40 | @node test/server
|
41 |
|
42 | docs: index.html test-docs docs/index.md
|
43 |
|
44 | index.html: docs/index.md docs/head.html docs/tail.html
|
45 | marked < $< \
|
46 | | cat docs/head.html - docs/tail.html \
|
47 | > $@
|
48 |
|
49 | docclean:
|
50 | rm -f index.html docs/test.html
|
51 |
|
52 | test-docs: docs/head.html docs/tail.html
|
53 | make test REPORTER=doc \
|
54 | | cat docs/head.html - docs/tail.html \
|
55 | > docs/test.html
|
56 |
|
57 | clean:
|
58 | rm -fr components
|
59 |
|
60 | .PHONY: test-cov test docs test-docs clean test-browser-local
|