forked from segment-boneyard/nightmare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
23 lines (20 loc) · 627 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
GREP ?=.
#check if xvfb is running
XVFB_RUNNING = $(shell pgrep "Xvfb" > /dev/null; echo $$?)
#set the circle project name if not set
CIRCLE_PROJECT_REPONAME ?= 1
#set headless if not set
HEADLESS ?= 1
test: node_modules
@rm -rf /tmp/nightmare
#if this build is not on circle, is not headless, and xvfb is not already running,
#run mocha as usual
#otherwise, run mocha under the xvfb wrapper
ifeq ($(CIRCLE_PROJECT_REPONAME)$(HEADLESS)$(XVFB_RUNNING), 111)
@node_modules/.bin/mocha --grep "$(GREP)"
else
@./test/bb-xvfb node_modules/.bin/mocha --grep "$(GREP)"
endif
node_modules: package.json
@npm install
.PHONY: test