diff --git a/services/web/Makefile b/services/web/Makefile index 720df034e8..469ab8e919 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -187,6 +187,9 @@ test: test_unit test_frontend test_acceptance test_unit: npm -q run test:unit -- ${MOCHA_ARGS} +test_unit_app: + npm -q run test:unit:app -- ${MOCHA_ARGS} + test_frontend: test_clean # stop service $(MAKE) compile docker-compose ${DOCKER_COMPOSE_FLAGS} up test_frontend diff --git a/services/web/bin/unit_test_app b/services/web/bin/unit_test_app new file mode 100755 index 0000000000..d0c3278618 --- /dev/null +++ b/services/web/bin/unit_test_app @@ -0,0 +1,6 @@ +#!/bin/bash +set -e; + +MOCHA="node_modules/.bin/mocha --exit --recursive --reporter spec" + +$MOCHA "$@" test/unit/js diff --git a/services/web/package.json b/services/web/package.json index 168aaf2066..ab9613e525 100644 --- a/services/web/package.json +++ b/services/web/package.json @@ -15,6 +15,7 @@ "test:acceptance:dir": "npm -q run test:acceptance:wait_for_app && npm -q run test:acceptance:run -- $@", "test:acceptance": "npm -q run test:acceptance:dir -- $@ test/acceptance/js", "test:unit": "npm -q run compile && bin/unit_test $@", + "test:unit:app": "npm -q run compile && bin/unit_test_app $@", "test:frontend": "karma start", "compile": "make compile", "start": "npm -q run compile && node $NODE_APP_OPTIONS app.js",