UNPKG

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