-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (57 loc) · 1.53 KB
/
Makefile
File metadata and controls
67 lines (57 loc) · 1.53 KB
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
58
59
60
61
62
63
64
65
66
67
ENV = test
REPORTER = spec
BIN = node_modules/.bin
SRC_FILES = $(shell find . -type f \( -name "*.js" ! \
-path "*node_modules*" ! -path "*lcov-report*" \))
DOCDIR = ../serverbone_gh-pages
DOCKER_OPTS = -u
# Use grep to run only tests with keywords:
# make test-server GREP=events
ifeq ($(GREP), )
GREP_CMND =
else
GREP_CMND = --grep '$(GREP)'
endif
MOCHA-OPTS = --reporter $(REPORTER) \
--require chai \
--ui bdd \
--recursive \
--colors
test:
@NODE_ENV=$(ENV) $(BIN)/mocha \
$(MOCHA-OPTS) \
$(GREP_CMND)
.PHONY: test
#debug by node-inspector + http://127.0.0.1:8080/debug?port=5858
test-d:
@NODE_ENV=test $(BIN)/mocha \
$(MOCHA-OPTS) \
--debug-brk \
$(GREP_CMND)
.PHONY: test-d
# Integration tests
INTEGRATION_TESTS = $(shell find test_integration -name '*_spec.js')
test-int:
@NODE_ENV=test $(BIN)/mocha \
$(MOCHA-OPTS) \
$(INTEGRATION_TESTS)
@$(MAKE) test ENV=test-integration
.PHONY: test-int
lint:
@$(BIN)/eslint $(SRC_FILES)
.PHONY: eslint
## Coverage:
test-coverage:
@NODE_ENV=test $(BIN)/istanbul cover $(BIN)/_mocha -- $(MOCHA-OPTS)
.PHONY: test-coverage
check-coverage: test-coverage
@$(BIN)/istanbul check-coverage --function 80 --branch 80 --statement 80 --lines 92
.PHONY: check-coverage
coveralls:
cat ./coverage/lcov.info | COVERALLS_SERVICE_NAME="travis-ci" ./node_modules/coveralls/bin/coveralls.js
## expects that gh-pages branch is checked out at $(DOCDIR)
docs:
mkdir -p $(DOCDIR)
$(BIN)/docker $(DOCKER_OPTS) -o $(DOCDIR) -i lib -c manni
cp $(DOCDIR)/index.js.html $(DOCDIR)/index.html
.PHONY: docs