Created
April 26, 2016 23:39
-
-
Save zmbush/ca028b27f99f87d77021685face50be5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
webpackConfig = require('./webpack.config.js'); | |
// Delete some stuff that confuses karma | |
webpackConfig.devtool = 'inline-source-map'; | |
delete webpackConfig.entry; | |
delete webpackConfig.output; | |
delete webpackConfig.context; | |
delete webpackConfig.plugins; | |
module.exports = function(config) { | |
config.set({ | |
basePath: '', | |
frameworks: ['mocha'], | |
files: [ | |
'tests.webpack.js', | |
], | |
coverageReporter: { | |
dir: '.testing-outputs', | |
reporters: [ | |
{ type: 'cobertura', subdir: '.', file: 'cobertura.xml' }, | |
{ type: 'text-summary' } | |
] | |
}, | |
junitReporter: { | |
outputDir: '.testing-outputs', | |
outputFile: 'javascript-test-results.xml', | |
useBrowserName: false, | |
suite: 'fe', | |
}, | |
preprocessors: { | |
'tests.webpack.js': ['webpack', 'sourcemap'], | |
}, | |
reporters: ['spec', 'coverage'], | |
webpack: Object.assign({}, webpackConfig, { | |
module: Object.assign({}, webpackConfig.module, { | |
preLoaders: [ | |
{ | |
test: /\.jsx?$/, | |
exclude: /(test|node_modules|bower_components)/, | |
loader: 'isparta' | |
} | |
] | |
}) | |
}), | |
webpackMiddleware: { | |
noInfo: true | |
}, | |
port: 9876, | |
colors: true, | |
logLevel: config.LOG_INFO, | |
autoWatch: true, | |
browsers: ['PhantomJS'], | |
singleRun: true, | |
concurrency: Infinity, | |
plugins: [ | |
'karma-chrome-launcher', | |
'karma-coverage', | |
'karma-mocha', | |
'karma-phantomjs-launcher', | |
'karma-sourcemap-loader', | |
'karma-spec-reporter', | |
'karma-junit-reporter', | |
'karma-webpack', | |
] | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment