forked from cnodejs/nodeclub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (27 loc) · 802 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
TESTS = $(shell find test -type f -name "*.js")
TESTTIMEOUT = 5000
REPORTER = spec
JSCOVERAGE = ./node_modules/jscover/bin/jscover
install:
@npm install
test: install
@if ! test -f config.js; then \
cp config.default.js config.js; \
fi
@if ! test -f assets.json; then \
make build; \
fi
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) --timeout $(TESTTIMEOUT) $(TESTS)
cov: install
@rm -rf .cov
@$(JSCOVERAGE) --exclude=public --exclude=test . .cov
@cp -rf node_modules test public .cov
test-cov: cov
@$(MAKE) -C .cov test REPORTER=progress
@$(MAKE) -C .cov test REPORTER=html-cov > coverage.html
build:
@./node_modules/loader/bin/build views .
start:
@nohup ./node_modules/.bin/forever `pwd`/app.js >> cnode.log 2>&1 &
.PHONY: test test-cov cov start