From a9f1989ecad4a9e8b63bdb75dbb3f25039c415a6 Mon Sep 17 00:00:00 2001 From: Tim Alby Date: Wed, 23 May 2018 14:10:33 +0200 Subject: [PATCH] add test_unit_app task --- services/web/Makefile | 3 +++ services/web/bin/unit_test_app | 6 ++++++ services/web/package.json | 1 + 3 files changed, 10 insertions(+) create mode 100755 services/web/bin/unit_test_app 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",