Просмотр исходного кода

Convert frontend test runs to use Docker/karma

Alasdair Smith 8 лет назад
Родитель
Сommit
24ec7b77ab
3 измененных файлов с 4 добавлено и 9 удалено
  1. 3 2
      services/web/Makefile
  2. 0 5
      services/web/bin/frontend_test
  3. 1 2
      services/web/package.json

+ 3 - 2
services/web/Makefile

@@ -181,8 +181,9 @@ test: test_unit test_frontend test_acceptance
 test_unit:
 	npm -q run test:unit -- ${MOCHA_ARGS}
 
-test_frontend:
-	npm -q run test:frontend -- ${MOCHA_ARGS}
+test_frontend: test_clean # stop service
+	$(MAKE) compile
+	docker-compose ${DOCKER_COMPOSE_FLAGS} up test_frontend
 
 test_acceptance: test_acceptance_app test_acceptance_modules
 

+ 0 - 5
services/web/bin/frontend_test

@@ -1,5 +0,0 @@
-#!/bin/bash
-set -e;
-MOCHA="node_modules/.bin/mocha --recursive --reporter spec"
-$MOCHA "$@" test/unit_frontend/js
-

+ 1 - 2
services/web/package.json

@@ -15,8 +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:frontend": "npm -q run compile && bin/frontend_test $@",
-    "test:karma": "npm -q run compile && karma start --single-run",
+    "test:frontend": "karma start --single-run",
     "compile": "make compile",
     "start": "npm -q run compile && node app.js",
     "nodemon": "nodemon --config nodemon.json",