forked from SpookyJS/SpookyJS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
35 lines (31 loc) · 1002 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
PWD = $(shell pwd)
TEST_REPORTER ?= dot
TEST_PORT ?= 8080
TEST_TIMEOUT ?= 4000
TEST_SLOW ?= 2000
NODE_MODULES = $(PWD)/node_modules
# XXX: below may be a bit too clever
PID_FILE := $(PWD)/$(shell echo ".test-server-pid.$$RANDOM")
fixture-server:
@cd tests/fixtures ; \
$(NODE_MODULES)/.bin/http-server -s -p $(TEST_PORT) & \
echo "$$!" > $(PID_FILE) ; \
cd $(PWD)
test: fixture-server
@$(NODE_MODULES)/.bin/mocha tests/test --recursive \
--globals define \
--timeout $(TEST_TIMEOUT) --slow $(TEST_SLOW) \
-R $(TEST_REPORTER) $(TEST_ARGS) ; \
STATUS=$$? ; \
kill -9 `cat $(PID_FILE)` ; rm $(PID_FILE) ; \
exit $$STATUS
cucumber.js: fixture-server
@TEST_PORT=$(TEST_PORT) $(NODE_MODULES)/.bin/cucumber.js \
-f pretty \
examples/cucumber/features \
--require examples/cucumber/features/steps \
--require examples/cucumber/features/support ; \
STATUS=$$? ; \
kill -9 `cat $(PID_FILE)` ; rm $(PID_FILE) ; \
exit $$STATUS
.PHONY: test fixture-server cucumber.js