UNPKG

1.33 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 $(NODETESTS)
17
18test-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
27test-cov: lib-cov
28 SUPERAGENT_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
29
30test-browser:
31 SAUCE_APPIUM_VERSION=1.7 ./node_modules/.bin/zuul -- $(BROWSERTESTS)
32
33test-browser-local:
34 ./node_modules/.bin/zuul --no-coverage --local 4000 -- $(BROWSERTESTS)
35
36lib-cov:
37 jscoverage lib lib-cov
38
39test-server:
40 @node test/server
41
42docs: index.html test-docs docs/index.md
43
44index.html: docs/index.md docs/head.html docs/tail.html
45 marked < $< \
46 | cat docs/head.html - docs/tail.html \
47 > $@
48
49docclean:
50 rm -f index.html docs/test.html
51
52test-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
57clean:
58 rm -fr components
59
60.PHONY: test-cov test docs test-docs clean test-browser-local