forked from microlinkhq/metascraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (28 loc) · 856 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
# Binaries.
bin = ./node_modules/.bin
browserify = $(bin)/browserify
mocha = $(bin)/mocha
mocha-phantomjs = $(bin)/mocha-phantomjs
# Flags.
DEBUG ?=
# Config.
ifeq ($(DEBUG),true)
mocha += debug
endif
# Install the dependencies.
node_modules: ./package.json
@ npm install
@ touch ./package.json
# Build the test source.
test/support/build.js: $(shell find ./lib) ./test/browser.js
@ $(browserify) --transform babelify --outfile ./test/support/build.js ./test/browser.js
# Run the tests.
test: test-browser test-server
# Run the browser-side tests.
test-browser: ./node_modules ./test/support/build.js
@ $(mocha-phantomjs) --reporter spec --timeout 5000 --bail ./test/support/browser.html
# Run the server-side tests.
test-server: ./node_modules
@ $(mocha) --reporter spec --timeout 5000 --bail ./test/server.js
# Phony targets.
.PHONY: test