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