forked from sutoiku/formula.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.37 KB
/
Makefile
File metadata and controls
55 lines (41 loc) · 1.37 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
BIN = ./node_modules/.bin
MOCHA_OPTS = --timeout 6000 --recursive
REPORTER = spec
S3_STOIC=s3cmd -c ~/.s3cmd/.stoic
S3_NPM_REPO=s3://npm-repo
GENERATED_TEST_FILES=test/generated/*.js
TEST_FILES = test
TEST_FILE?=you_must_specify_the_test_file
lint:
$(BIN)/jshint lib/* test/*
test: lint generate-tests
$(BIN)/mocha $(MOCHA_OPTS) --reporter $(REPORTER) $(TEST_FILES)
generate-tests:
rm $(GENERATED_TEST_FILES) || true
@node util/generate-mocha-test-cases.js
test-reports: lib-cov
[ -d "reports" ] && rm -rf reports/* || true
mkdir -p reports
$(MAKE) -k test REPORTER="xunit > reports/tests.xml"
$(MAKE) -k test REPORTER="doc > reports/tests-doc.html"
$(MAKE) -k test-cov
local-install:
@npm install
package: clean
@npm pack
check: local-install test-reports test-cov
lib-cov:
[ -d "lib-cov" ] && rm -rf lib-cov || true
$(BIN)/istanbul instrument --output lib-cov --no-compact --variable global.__coverage__ lib
test-cov: lib-cov generate-tests
@IMPORTERJS_COV=1 $(MAKE) test "REPORTER=mocha-istanbul" ISTANBUL_REPORTERS=text-summary,html,cobertura
@echo
@echo open html-report/index.html file in your browser
clean:
[ -d "lib-cov" ] && rm -rf lib-cov || true
[ -d "reports" ] && rm -rf reports || true
[ -d "build" ] && rm -rf build || true
[ -d "html-report" ] && rm -rf html-report || true
deploy: package
$(S3_STOIC) put *.tgz $(S3_NPM_REPO)
.PHONY: test lib-cov