Preprocess test scripts with webpack

This commit is contained in:
Tim Schaub
2017-08-27 10:42:23 -06:00
committed by Tim Schaub
parent 4515b8fe70
commit b0c0166e9b
2 changed files with 8 additions and 1 deletions

View File

@@ -17,7 +17,7 @@
"pretest": "npm run lint", "pretest": "npm run lint",
"test": "npm run karma -- --single-run", "test": "npm run karma -- --single-run",
"debug-server": "node tasks/serve-lib.js", "debug-server": "node tasks/serve-lib.js",
"karma": "node tasks/test.js start test/karma.config.js", "karma": "karma start test/karma.config.js",
"transform-src": "jscodeshift --transform transforms/module.js src", "transform-src": "jscodeshift --transform transforms/module.js src",
"changecase-src": "node tasks/filename-case-from-module.js", "changecase-src": "node tasks/filename-case-from-module.js",
"transform-examples": "jscodeshift --transform transforms/module.js examples", "transform-examples": "jscodeshift --transform transforms/module.js examples",
@@ -79,6 +79,7 @@
"karma-firefox-launcher": "^1.0.1", "karma-firefox-launcher": "^1.0.1",
"karma-mocha": "^1.3.0", "karma-mocha": "^1.3.0",
"karma-sauce-launcher": "^1.1.0", "karma-sauce-launcher": "^1.1.0",
"karma-webpack": "^2.0.4",
"marked": "0.3.7", "marked": "0.3.7",
"metalsmith": "2.3.0", "metalsmith": "2.3.0",
"metalsmith-layouts": "1.8.1", "metalsmith-layouts": "1.8.1",

View File

@@ -57,6 +57,9 @@ module.exports = function(karma) {
'/rendering/': '/base/rendering/', '/rendering/': '/base/rendering/',
'/spec/': '/base/spec/' '/spec/': '/base/spec/'
}, },
preprocessors: {
'**/*.js': ['webpack']
},
reporters: ['progress'], reporters: ['progress'],
coverageReporter: { coverageReporter: {
reporters: [ reporters: [
@@ -69,6 +72,9 @@ module.exports = function(karma) {
type: 'text-summary' // prints the textual summary to the terminal type: 'text-summary' // prints the textual summary to the terminal
} }
] ]
},
webpackMiddleware: {
noInfo: true
} }
}); });