Tim Alby 8 лет назад
Родитель
Сommit
a9f1989eca
3 измененных файлов с 10 добавлено и 0 удалено
  1. 3 0
      services/web/Makefile
  2. 6 0
      services/web/bin/unit_test_app
  3. 1 0
      services/web/package.json

+ 3 - 0
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

+ 6 - 0
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

+ 1 - 0
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",