-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
41 lines (34 loc) · 791 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
TESTS = $(shell ls -S `find test -type f -name "*.test.js" -print`)
REGISTRY = http://r.cnpmjs.org
REPORTER = spec
TIMEOUT = 3000
MOCHA_OPTS =
install:
@npm install \
--registry=$(REGISTRY)
jshint: install
@./node_modules/.bin/jshint .
test: install
@NODE_ENV=test ./node_modules/.bin/mocha \
--bail \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
--require should \
$(MOCHA_OPTS) \
$(TESTS)
test-cov cov: install
@NODE_ENV=test node \
node_modules/.bin/istanbul cover \
./node_modules/.bin/_mocha \
--bail \
-- -u exports \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
--require should \
$(MOCHA_OPTS) \
$(TESTS)
test-all all: install jshint test cov
clean:
@rm -rf node_modules
@rm -rf coverage
.PHONY: test test-all test-cov cov all clean