UNPKG

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