2017-01-17 13:40:59 +01:00
|
|
|
const path = require('path');
|
|
|
|
|
2017-05-11 14:17:21 +02:00
|
|
|
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' },
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|