forked from springernature/shunter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (33 loc) · 1.04 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
# Color helpers
C_CYAN=\x1b[34;01m
C_RESET=\x1b[0m
# Group targets
all: deps lint lcov-levels
ci: lint lcov-levels
# Install dependencies
deps:
@echo "$(C_CYAN)> installing dependencies$(C_RESET)"
@npm install
# Run all linters
lint: jshint jscs
# Lint JavaScript
jshint:
@echo "$(C_CYAN)> linting javascript$(C_RESET)"
@./node_modules/.bin/jshint .
# Run JavaScript Code Style
jscs:
@echo "$(C_CYAN)> checking javascript code style$(C_RESET)"
@./node_modules/.bin/jscs .
# Run all tests
test: test-server
# Run unit tests
test-server:
@echo "$(C_CYAN)> running server-side unit tests$(C_RESET)"
@./node_modules/.bin/mocha --recursive --reporter spec --ui bdd ./tests/server
test-cov:
@echo "$(C_CYAN)> checking test coverage $(C_RESET)"
@./node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha -- --recursive --reporter spec --ui bdd ./tests/server
lcov-levels: test-cov
@echo "$(C_CYAN)> checking coverage levels $(C_RESET)"
@./node_modules/.bin/istanbul check-coverage --statement 80 --branch 80 --function 80
.PHONY: test