-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
37 lines (28 loc) · 1.13 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
SRC_FILES := $(shell find src -name '*.ts')
lib: ${SRC_FILES} package.json tsconfig.json node_modules rollup.config.js
@./node_modules/.bin/rollup -c && touch lib
.PHONY: test
test: node_modules
@TS_NODE_PROJECT='./test/tsconfig.json' \
./node_modules/.bin/mocha -u tdd -r ts-node/register --extension ts test/*.ts --grep '$(grep)' --exit --timeout 15000
.PHONY: coverage
coverage: node_modules
@TS_NODE_PROJECT='./test/tsconfig.json' nyc --reporter=html mocha -u tdd -r ts-node/register --extension ts test/*.ts -R nyan && open coverage/index.html
.PHONY: lint
lint: node_modules
@./node_modules/.bin/eslint src --ext .ts --fix
.PHONY: ci-test
ci-test: node_modules
@TS_NODE_PROJECT='./test/tsconfig.json' ./node_modules/.bin/nyc --reporter=text \
./node_modules/.bin/mocha -u tdd -r ts-node/register --extension ts test/*.ts -R list
.PHONY: ci-lint
ci-lint: node_modules
@./node_modules/.bin/eslint src --ext .ts --max-warnings 0 --format unix && echo "Ok"
node_modules:
yarn install --non-interactive --frozen-lockfile --ignore-scripts
.PHONY: clean
clean:
rm -rf lib/ coverage/
.PHONY: distclean
distclean: clean
rm -rf node_modules/