UNPKG

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