Skip to content

Commit adea902

Browse files
authored
test: run unit tests before integration tests (#1832)
This change: * will allow a failed unit test to fail the full test pipeline significantly faster than previously * isolates unit tests from integration tests * loads less irrelevant files when running mocha test suites (e.g. `test/util/**`, `test/format/**`, `test/data/**` only loaded on demand) * protects against mistakes like that fixed in #1828
1 parent 05bc5c0 commit adea902

2 files changed

Lines changed: 4 additions & 18 deletions

File tree

.mocharc.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ debug: base
100100

101101
.PHONY: test
102102
test: lint
103-
BCRYPT=insecure npx mocha --recursive
103+
$(MAKE) test-unit
104+
$(MAKE) test-integration
104105

105106
.PHONY: test-db-migrations
106107
test-db-migrations:
@@ -110,7 +111,8 @@ test-db-migrations:
110111

111112
.PHONY: test-fast
112113
test-fast: node_version
113-
NODE_CONFIG_ENV=test BCRYPT=insecure npx mocha --recursive --fgrep @slow --invert
114+
MOCHA_OPTIONS="--fgrep @slow --invert" $(MAKE) test-unit
115+
MOCHA_OPTIONS="--fgrep @slow --invert" $(MAKE) test-integration
114116

115117
.PHONY: test-integration
116118
test-integration: node_version

0 commit comments

Comments
 (0)