forked from StevenLooman/saxpath
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (21 loc) · 845 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
VERSION=$(shell grep '"version"' package.json | sed 's/ "version": "\(.*\)",/\1/')
test: test-unit
test-unit: node_modules
@./node_modules/.bin/mocha test --reporter dot
test-unit-cov: node_modules lib-cov
@JS_COV=1 ./node_modules/.bin/mocha test --reporter html-cov > coverage_unit.html
@open coverage_unit.html
.PHONY: lib-cov
lib-cov: node_modules
@node_modules/jscover/bin/jscover lib lib-cov
node_modules:
@npm install .
sonar: node_modules lib-cov
@rm -rf coverage
@mkdir coverage
@JS_COV=1 ./node_modules/.bin/mocha -R mocha-lcov-reporter > coverage/coverage_temp.lcov
@sed 's,SF:,SF:lib/,' coverage/coverage_temp.lcov > coverage/coverage.lcov
@./node_modules/.bin/mocha -R xunit > coverage/TEST-all.xml
@sonar-runner -Dsonar.projectVersion=$(VERSION)
clean:
@rm -rf node_modules lib-cov coverage coverage_unit.html