forked from taboola/analytics.js-integrations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
83 lines (65 loc) · 1.5 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#
# Helpers to test only a specific `integration` or `browser`, or on a `port`.
#
integration ?= *
browser ?= ie10
#
# Binaries.
#
src = $(wildcard i*.js lib/*/*.js test/*.js)
tests = /test
duo = node_modules/.bin/duo
phantomjs = node_modules/.bin/duo-test phantomjs $(tests) args: \
--setting local-to-remote-url-access=true \
--setting web-security=false \
--path node_modules/.bin/phantomjs
#
# Commands.
#
default: build.js
test: build.js test-style
@node bin/tests
@$(phantomjs)
test-browser: build.js
@node bin/tests
@node_modules/.bin/duo-test browser --commands "make default" $(tests)
test-sauce: node_modules build.js
@node bin/tests
@node_modules/.bin/duo-test saucelabs $(tests) \
--name analytics.js-integrations \
--browser $(browser) \
--user $(SAUCE_USERNAME) \
--key $(SAUCE_ACCESS_KEY)
test-cov:
@./node_modules/.bin/istanbul cover \
node_modules/.bin/_mocha $(TESTS) \
--report lcovonly \
-- -u exports \
--require should \
--timeout 20s \
--reporter dot
test-style:
@node_modules/.bin/jscs lib
clean:
@-rm -rf $(TMPDIR)/duo
@rm -rf build.js components integrations.js node_modules test/tests.js
#
# Targets.
#
build.js: node_modules integrations.js $(src)
@-rm -rf $(TMPDIR)/duo
@node bin/tests
@$(duo) --development test/index.js > build.js
integrations.js: $(wildcard lib/*)
@node bin/integrations
node_modules: package.json
@npm install
#
# Phonies.
#
.PHONY: clean
.PHONY: test
.PHONY: test-browser
.PHONY: test-coverage
.PHONY: test-sauce
.PHONY: test-style