UNPKG

1.28 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 --reporter $(REPORTER) \
14 --timeout 5000 \
15 $(NODETESTS)
16
17test-node-http2:
18 @NODE_ENV=test HTTP2_TEST=1 node ./node_modules/.bin/mocha \
19 --require should \
20 --trace-warnings \
21 --reporter $(REPORTER) \
22 --timeout 5000 \
23 $(NODETESTS)
24
25test-cov: lib-cov
26 SUPERAGENT_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
27
28test-browser:
29 SAUCE_APPIUM_VERSION=1.7 ./node_modules/.bin/zuul -- $(BROWSERTESTS)
30
31test-browser-local:
32 ./node_modules/.bin/zuul --no-coverage --local 4000 -- $(BROWSERTESTS)
33
34lib-cov:
35 jscoverage lib lib-cov
36
37test-server:
38 @node test/server
39
40docs: index.html test-docs docs/index.md
41
42index.html: docs/index.md docs/head.html docs/tail.html
43 marked < $< \
44 | cat docs/head.html - docs/tail.html \
45 > $@
46
47docclean:
48 rm -f index.html docs/test.html
49
50test-docs: docs/head.html docs/tail.html
51 make test REPORTER=doc \
52 | cat docs/head.html - docs/tail.html \
53 > docs/test.html
54
55clean:
56 rm -fr components
57
58.PHONY: test-cov test docs test-docs clean test-browser-local