-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
37 lines (32 loc) · 814 Bytes
/
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
all: help
## build: build TypeScript source
.PHONY: build
build: node_modules
./node_modules/.bin/tsc || (rm -rf dist; exit 1)
## clean: delete NPM packages and generated files
.PHONY: clean
clean:
rm -rf dist node_modules package-lock.json npm-debug.log .nyc* coverage
## test: run tests
.PHONY: test
test: node_modules build
./node_modules/.bin/c8 \
--reporter=none \
./node_modules/.bin/ts-mocha -b 'src/**/*.spec.ts' \
&& ./node_modules/.bin/c8 report \
--all \
--bail \
--clean \
--reporter=html \
--reporter=lcov \
--reporter=text \
-n src \
-x 'src/**/*.spec.ts' \
-x 'src/http-hash.d.ts' \
-x 'src/types.*'
.PHONY: help
help:
@sed -n 's/^##//p' Makefile
node_modules: package.json
npm update || (rm -rf node_modules; exit 1)
touch node_modules