Skip to content

Commit

Permalink
Build: Add /shared path to unit test runner
Browse files Browse the repository at this point in the history
Tests in /shared were not being run by the test runner. Some makefiles
also needed tweaking.

The /shared folder will be removed soon but the tests should be run
in the meantime.
  • Loading branch information
seear authored and ockham committed Dec 16, 2015
1 parent 1a9298b commit 7cea6ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/run-all-tests
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ __cleanup() {
trap __cleanup SIGINT SIGTERM

# Run all tests
find {$BASEDIR/../client,$BASEDIR/../server} -name Makefile | run_test_fast
find {$BASEDIR/../client,$BASEDIR/../server,$BASEDIR/../shared} -name Makefile | run_test_fast
7 changes: 5 additions & 2 deletions shared/lib/formatting/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
REPORTER ?= spec
MOCHA ?= ../../../node_modules/.bin/mocha
NODE_BIN := $(shell npm bin)
MOCHA ?= $(NODE_BIN)/mocha
BASE_DIR := $(NODE_BIN)/../..
NODE_PATH := test:$(BASE_DIR)/client:$(BASE_DIR)/shared

# In order to simply stub modules, add test to the NODE_PATH
test:
@NODE_ENV=test NODE_PATH=test:../../../client $(MOCHA) --compilers js:babel/register --reporter $(REPORTER)
@NODE_ENV=test NODE_PATH=$(NODE_PATH) $(MOCHA) --compilers js:babel/register --reporter $(REPORTER)

.PHONY: test

0 comments on commit 7cea6ba

Please sign in to comment.