Skip to content

Commit b23bf28

Browse files
committed
Move test task into each separate makefile
1 parent a603ffa commit b23bf28

File tree

9 files changed

+47
-14
lines changed

9 files changed

+47
-14
lines changed

common.mk

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,6 @@ lint:
1919
@eslint --config $(ROOT)/eslint_test.json --max-warnings 0 test/
2020
@echo -e " $(OK) $@"
2121

22-
test:
23-
ifneq (,$(wildcard ./test/index.js))
24-
@nyc --reporter=text --reporter=html mocha \
25-
--recursive --ui tdd \
26-
--require $(ROOT)/mocha_setup \
27-
--require ./test/index \
28-
test/**/*_test.js
29-
else
30-
@nyc --reporter=text --reporter=html mocha \
31-
--recursive --ui tdd \
32-
--require $(ROOT)/mocha_setup \
33-
test/**/*_test.js
34-
endif
35-
3622
html:
3723
ifneq (,$(wildcard ./.esdoc.json))
3824
@esdoc

fluent-bundle/makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ include ../common.mk
55

66
build: index.js compat.js
77

8+
test:
9+
@nyc --reporter=text --reporter=html mocha \
10+
--recursive --ui tdd \
11+
--require $(ROOT)/mocha_setup \
12+
--require ./test/index \
13+
test/**/*_test.js
14+
815
index.js: $(SOURCES)
916
@rollup $(CURDIR)/src/index.js \
1017
--config $(ROOT)/bundle_config.js \

fluent-dedent/makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ include ../common.mk
55

66
build: index.js compat.js
77

8+
test:
9+
@nyc --reporter=text --reporter=html mocha \
10+
--recursive --ui tdd \
11+
--require $(ROOT)/mocha_setup \
12+
test/**/*_test.js
13+
814
index.js: $(SOURCES)
915
@rollup $(CURDIR)/src/index.js \
1016
--config $(ROOT)/bundle_config.js \

fluent-dom/makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ DEPS := cached-iterable:CachedIterable
44

55
include ../common.mk
66

7+
test:
8+
@nyc --reporter=text --reporter=html mocha \
9+
--recursive --ui tdd \
10+
--require $(ROOT)/mocha_setup \
11+
--require ./test/index \
12+
test/**/*_test.js
13+
714
build: index.js compat.js
815

916
index.js: $(SOURCES)

fluent-gecko/makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ include ../common.mk
66
version = $(1)@$(shell node -e "\
77
console.log(require('../$(1)/package.json').version)")
88

9+
test:
10+
@nyc --reporter=text --reporter=html mocha \
11+
--recursive --ui tdd \
12+
--require $(ROOT)/mocha_setup \
13+
test/**/*_test.js
14+
915
build: Fluent.jsm FluentSyntax.jsm Localization.jsm DOMLocalization.jsm l10n.js fluent-react.js
1016

1117
Fluent.jsm: $(SOURCES)

fluent-langneg/makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ GLOBAL := FluentLangNeg
33

44
include ../common.mk
55

6+
test:
7+
@nyc --reporter=text --reporter=html mocha \
8+
--recursive --ui tdd \
9+
--require $(ROOT)/mocha_setup \
10+
test/**/*_test.js
11+
612
build: index.js compat.js
713

814
index.js: $(SOURCES)

fluent-react/makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ include ../common.mk
66

77
build: index.js compat.js
88

9+
test:
10+
./node_modules/.bin/jest --collect-coverage
11+
912
index.js: $(SOURCES)
1013
@rollup $(CURDIR)/src/index.js \
1114
--config $(ROOT)/bundle_config.js \

fluent-sequence/makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ GLOBAL := FluentSequence
33

44
include ../common.mk
55

6+
test:
7+
@nyc --reporter=text --reporter=html mocha \
8+
--recursive --ui tdd \
9+
--require $(ROOT)/mocha_setup \
10+
test/**/*_test.js
11+
612
build: index.js compat.js
713

814
index.js: $(SOURCES)

fluent-syntax/makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ GLOBAL := FluentSyntax
33

44
include ../common.mk
55

6+
test:
7+
@nyc --reporter=text --reporter=html mocha \
8+
--recursive --ui tdd \
9+
--require $(ROOT)/mocha_setup \
10+
test/**/*_test.js
11+
612
build: index.js compat.js
713

814
index.js: $(SOURCES)

0 commit comments

Comments
 (0)