-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (31 loc) · 1.02 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
BIN = ./node_modules/.bin
TEST_OPTS = --timeout 100 --reporter list --globals __coverage__ --compilers coffee:coffee-script
COFFEE_OPTS = --bare --compile
ISTANBUL_OPTS = instrument --variable global.__coverage__ --no-compact
SRC_FILES := $(wildcard src/*.coffee)
LIB_FILES := $(SRC_FILES:src/%.coffee=lib/%.js)
TEST_FILES = test/*.coffee
COV_FILES := $(LIB_FILES:lib/%.js=lib-cov/%.js)
default: test
lib/%.js: src/%.coffee
$(BIN)/coffee $(COFFEE_OPTS) --output $(@D) $<
lib-cov/%.js: lib/%.js
mkdir -p ./lib-cov
$(BIN)/istanbul $(ISTANBUL_OPTS) --output $@ $<
all: $(LIB_FILES)
publish: clean all
npm publish
test:
$(BIN)/mocha $(TEST_OPTS) $(TEST_FILES)
tdd:
$(BIN)/mocha $(TEST_OPTS) --watch $(TEST_FILES)
instrument: $(COV_FILES)
cover: instrument
COVER=1 $(BIN)/mocha $(TEST_OPTS) --reporter mocha-istanbul $(TEST_FILES)
@echo open html-report/index.html to view coverage report.
clean:
rm -Rf html-report
rm -Rf coverage
rm -Rf lib-cov
rm -Rf lib
.PHONY: instrument all default test watch cover clean lib-cov