forked from segmentio/localstorage-retry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (51 loc) · 1.15 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
##
# Binaries
##
ESLINT := node_modules/.bin/eslint
KARMA := node_modules/.bin/karma
##
# Files
##
LIBS = $(shell find lib -type f -name "*.js")
TESTS = $(shell find test -type f -name "*.test.js")
SUPPORT = $(wildcard karma.conf*.js)
ALL_FILES = $(LIBS) $(TESTS) $(SUPPORT)
##
# Program options/flags
##
# A list of options to pass to Karma
# Overriding this overwrites all options specified in this file (e.g. BROWSERS)
KARMA_FLAGS ?=
# A list of Karma browser launchers to run
# http://karma-runner.github.io/0.13/config/browsers.html
BROWSERS ?=
ifdef BROWSERS
KARMA_FLAGS += --browsers $(BROWSERS)
endif
ifdef CI
KARMA_CONF ?= karma.conf.ci.js
else
KARMA_CONF ?= karma.conf.js
endif
# Mocha flags.
GREP ?= .
##
# Tasks
##
# Install node modules.
node_modules: package.json $(wildcard node_modules/*/package.json)
@npm install
@touch $@
# Install dependencies.
install: node_modules
# Lint JavaScript source files.
lint: install
@$(ESLINT) $(ALL_FILES)
.PHONY: lint
# Run browser unit tests in a browser.
test-browser: install
@$(KARMA) start $(KARMA_FLAGS) $(KARMA_CONF)
# Default test target.
test: lint test-browser
.PHONY: test
.DEFAULT_GOAL = test