From b417516c7ff5a28a9b23c50a7cd5bba656be0180 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Thu, 29 Mar 2018 17:11:17 +0100 Subject: [PATCH 1/2] Add CSS to karma This is useful for rich text tests which rely on DOM structure/CSS layout of rich text --- services/web/karma.conf.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/web/karma.conf.js b/services/web/karma.conf.js index d4eab91999..57b84394c1 100644 --- a/services/web/karma.conf.js +++ b/services/web/karma.conf.js @@ -26,7 +26,10 @@ module.exports = function (config) { { pattern: 'test/unit_frontend/js/**/*.js', included: false }, // Include ES test files 'test/unit_frontend/es/**/*.js', - 'modules/**/test/unit_frontend/es/**/*.js' + 'modules/**/test/unit_frontend/es/**/*.js', + // Include CSS (there is some in js/libs dir) + 'public/stylesheets/**/*.css', + 'public/js/libs/**/*.css' ], middleware: ['fake-img'], preprocessors: { @@ -74,4 +77,4 @@ function fakeImgMiddlewareFactory () { } next() } -} \ No newline at end of file +} From 1d6dd06b88f63a9320d7da8d4067848ebf41c9d8 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Wed, 4 Apr 2018 13:19:21 +0100 Subject: [PATCH 2/2] Serve underscore in karma tests Because of the way that we're using underscore in the ES bundle (using the global), we need to include underscore globally --- services/web/karma.conf.js | 1 + 1 file changed, 1 insertion(+) diff --git a/services/web/karma.conf.js b/services/web/karma.conf.js index 57b84394c1..b9c8bd8533 100644 --- a/services/web/karma.conf.js +++ b/services/web/karma.conf.js @@ -18,6 +18,7 @@ module.exports = function (config) { 'public/js/libs/angular-1.6.4.min.js', 'public/js/libs/angular-mocks.js', 'public/js/libs/jquery-1.11.1.min.js', + 'public/js/libs/underscore-1.3.3.js', // Set up requirejs 'test/unit_frontend/js/test-main.js', // Include source & test files, but don't "include" them as requirejs