1 | # Group targets
|
2 | all: deps lint lcov-levels
|
3 | ci: lint lcov-levels
|
4 |
|
5 | # Install dependencies
|
6 | deps:
|
7 | @echo "> Installing dependencies"
|
8 | @npm install
|
9 |
|
10 | # Run all linters
|
11 | lint: xo
|
12 |
|
13 | # Lint JavaScript
|
14 | xo:
|
15 | @echo "> Linting javascript"
|
16 | @./node_modules/.bin/xo
|
17 |
|
18 | snyk:
|
19 | @./node_modules/.bin/snyk test --org=springernature
|
20 |
|
21 | # Run all tests
|
22 | test: lcov-levels
|
23 |
|
24 | # Run unit tests
|
25 | test-server:
|
26 | @echo "> Running server-side unit tests"
|
27 | @./node_modules/.bin/mocha --opts ./tests/mocha.opts ./tests/server
|
28 |
|
29 | test-cov:
|
30 | @echo "> Checking test coverage"
|
31 | @./node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha -- --opts ./tests/mocha.opts ./tests/server
|
32 |
|
33 | lcov-levels: test-cov
|
34 | @echo "> Checking coverage levels"
|
35 | @./node_modules/.bin/istanbul check-coverage --statement 80 --branch 80 --function 80
|
36 |
|
37 |
|
38 | .PHONY: test
|