64 lines
1.3 KiB
JavaScript
Raw Normal View History

2017-01-17 13:40:59 +01:00
const path = require('path');
const argv = require('minimist')(process.argv.slice(2));
const webpackConfig = require('../webpack/webpack.test.babel');
2017-01-17 13:40:59 +01:00
module.exports = (config) => {
config.set({
frameworks: ['mocha'],
reporters: ['coverage', 'mocha'],
browsers: process.env.TRAVIS // eslint-disable-line no-nested-ternary
? ['ChromeTravis']
: process.env.APPVEYOR
? ['IE'] : ['Chrome'],
autoWatch: false,
singleRun: true,
client: {
mocha: {
grep: argv.grep,
},
},
files: [
{
pattern: './test-bundler.js',
watched: false,
served: true,
included: true,
},
],
preprocessors: {
['./test-bundler.js']: ['webpack', 'sourcemap'], // eslint-disable-line no-useless-computed-key
},
webpack: webpackConfig,
// make Webpack bundle generation quiet
webpackMiddleware: {
noInfo: true,
stats: 'errors-only',
},
customLaunchers: {
ChromeTravis: {
base: 'Chrome',
flags: ['--no-sandbox'],
},
},
coverageReporter: {
dir: path.join(process.cwd(), 'coverage'),
reporters: [
{ type: 'lcov', subdir: 'lcov' },
{ type: 'html', subdir: 'html' },
{ type: 'text-summary' },
],
},
});
};