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