/
Makefile
57 lines (45 loc) · 1.47 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
SRC ?= lib
TESTS = test
NAME ?= $(shell node -e 'console.log(require("./package.json").name)')
VERSION ?= $(shell node -e 'console.log(require("./package.json").version)')
NODE ?= $(shell which node)
NPM ?= $(shell which npm)
JSHINT ?= node_modules/jshint/bin/jshint
MOCHA ?= node_modules/mocha/bin/mocha
REPORTER ?= spec
NODEMON ?= node_modules/nodemon/bin/nodemon.js
all: dev lint test safe
test:
@echo -----------------
@echo - RUNNING TESTS -
@echo -----------------
$(NODE) $(MOCHA) --reporter $(REPORTER) $(TESTS)
test-dev:
@echo ---------------------------------------------
@echo - TESTS AUTOMATICALLY RERUN ON FILE CHANGES -
@echo ---------------------------------------------
$(NODE) $(MOCHA) $(TESTS) --reporter $(REPORTER) --watch $(SRC)
dev:
@echo -----------------------
@echo - INSTALLING DEV DEPS -
@echo -----------------------
$(NPM) install
lint:
@echo ------------------
@echo - LINTING SOURCE -
@echo ------------------
$(NODE) $(JSHINT) $(SRC)
@echo -----------------
@echo - LINTING TESTS -
@echo -----------------
$(NODE) $(JSHINT) $(TESTS)
safe:
nsp check
release: lint test safe
@echo ------------------------------------------
@echo - ready to bump versions and npm release -
@echo ------------------------------------------
coverage:
$(NPM) install istanbul
node_modules/istanbul/lib/cli.js cover node_modules/mocha/bin/_mocha -- test/*.js test/integration/*.js --reporter spec
.PHONY: dev lint test test-dev integration-test build build-dev