diff --git a/src/config/karma-webpack-bundle.js b/src/config/karma-webpack-bundle.js new file mode 100644 index 000000000..3b6f7a1dc --- /dev/null +++ b/src/config/karma-webpack-bundle.js @@ -0,0 +1,6 @@ +// This is webpack specific. It will create a single bundle +// out of all files ending in ".spec.js" within the "test" +// directory and all its subdirectories. +'use strict' +const testsContext = require.context('../../../../test', true, /\.spec\.js/) +testsContext.keys().forEach(testsContext) diff --git a/src/test/browser-config.js b/src/test/browser-config.js index e6e113948..ca5522fb3 100644 --- a/src/test/browser-config.js +++ b/src/test/browser-config.js @@ -15,7 +15,7 @@ function getPatterns (ctx) { return [ 'test/browser.js', - 'test/**/*.spec.js' + 'node_modules/aegir/src/config/karma-webpack-bundle.js' ] } @@ -76,6 +76,9 @@ function getConfig (isWebworker, ctx) { junitReporter: { outputFile: isWebworker ? 'junit-report-webworker.xml' : 'junit-report-browser.xml' }, + preprocessors: { + 'node_modules/aegir/src/config/karma-webpack-bundle.js': ['webpack'] + }, browserNoActivityTimeout: 50 * 1000, customLaunchers: { ChromeCustom: {