2018-12-19 07:42:07 +00:00
|
|
|
let webpackConfig = require('./webpack.config.js');
|
2018-12-20 13:37:29 +00:00
|
|
|
Object.assign(webpackConfig, {
|
|
|
|
entry: undefined,
|
|
|
|
output: undefined,
|
|
|
|
optimization: undefined,
|
|
|
|
plugins: undefined,
|
|
|
|
devtool: 'inline-source-map'
|
|
|
|
});
|
2017-08-25 06:42:53 +00:00
|
|
|
|
|
|
|
// Karma configuration
|
|
|
|
// Generated on Tue Aug 22 2017 13:37:43 GMT+0200 (CEST)
|
|
|
|
|
|
|
|
module.exports = function(config) {
|
2018-01-30 15:34:32 +00:00
|
|
|
let baseConfig = {
|
2017-08-25 06:42:53 +00:00
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// base path that will be used to resolve all patterns (eg. files, exclude)
|
2017-08-25 06:42:53 +00:00
|
|
|
basePath: '',
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// frameworks to use
|
|
|
|
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
2017-08-25 06:42:53 +00:00
|
|
|
frameworks: ['jasmine'],
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// list of files / patterns to load in the browser
|
2017-08-25 06:42:53 +00:00
|
|
|
files: [
|
2018-12-22 10:59:26 +00:00
|
|
|
{pattern: 'front/test_index.js', watched: false}
|
2017-08-25 06:42:53 +00:00
|
|
|
],
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// list of files to exclude
|
2017-08-25 06:42:53 +00:00
|
|
|
exclude: [],
|
|
|
|
|
|
|
|
webpack: webpackConfig,
|
|
|
|
|
|
|
|
webpackMiddleware: {
|
|
|
|
stats: 'errors-only'
|
|
|
|
},
|
|
|
|
|
|
|
|
webpackServer: {
|
|
|
|
noInfo: true
|
|
|
|
},
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// preprocess matching files before serving them to the browser
|
|
|
|
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
2017-08-25 06:42:53 +00:00
|
|
|
preprocessors: {
|
2018-12-22 10:59:26 +00:00
|
|
|
'./front/test_index.js': ['webpack', 'sourcemap']
|
2017-08-25 06:42:53 +00:00
|
|
|
},
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// test results reporter to use
|
|
|
|
// possible values: 'dots', 'progress'
|
|
|
|
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
2017-08-25 06:42:53 +00:00
|
|
|
reporters: ['progress'],
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// web server port
|
2017-08-25 06:42:53 +00:00
|
|
|
port: 9876,
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// enable / disable colors in the output (reporters and logs)
|
2017-08-25 06:42:53 +00:00
|
|
|
colors: true,
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// level of logging
|
|
|
|
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
2017-08-25 06:42:53 +00:00
|
|
|
logLevel: config.LOG_INFO,
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// enable / disable watching file and executing tests whenever any file changes
|
2017-08-25 06:42:53 +00:00
|
|
|
autoWatch: true,
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// start these browsers
|
|
|
|
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
|
|
|
browsers: ['ChromeNoSandboxHeadless'],
|
2017-08-25 06:42:53 +00:00
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// Continuous Integration mode
|
|
|
|
// if true, Karma captures browsers, runs the tests and exits
|
2017-08-25 06:42:53 +00:00
|
|
|
singleRun: false,
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
// Concurrency level
|
|
|
|
// how many browser should be started simultaneous
|
2017-08-25 06:42:53 +00:00
|
|
|
concurrency: Infinity,
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
'karma-jasmine',
|
|
|
|
'karma-webpack',
|
|
|
|
'karma-chrome-launcher',
|
2017-08-29 11:41:55 +00:00
|
|
|
'karma-firefox-launcher',
|
2017-08-25 06:42:53 +00:00
|
|
|
'karma-sourcemap-loader'
|
2018-10-18 18:48:21 +00:00
|
|
|
],
|
2018-01-30 13:48:21 +00:00
|
|
|
|
2018-10-18 18:48:21 +00:00
|
|
|
customLaunchers: {
|
|
|
|
ChromeNoSandboxHeadless: {
|
|
|
|
base: 'Chrome',
|
|
|
|
flags: [
|
|
|
|
'--no-sandbox',
|
|
|
|
// See https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
|
|
|
|
'--headless',
|
|
|
|
'--disable-gpu',
|
|
|
|
// Without a remote debugging port, Google Chrome exits immediately.
|
2018-12-20 13:37:29 +00:00
|
|
|
'--remote-debugging-port=9222'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
FirefoxHeadless: {
|
|
|
|
base: 'Firefox',
|
|
|
|
flags: ['-headless']
|
|
|
|
},
|
|
|
|
ChromiumHeadless: {
|
|
|
|
base: 'Chromium',
|
|
|
|
flags: [
|
|
|
|
'--no-sandbox',
|
|
|
|
'--headless',
|
|
|
|
'--disable-gpu',
|
|
|
|
'--remote-debugging-port=9222'
|
2018-10-18 18:48:21 +00:00
|
|
|
]
|
2018-01-30 15:34:32 +00:00
|
|
|
}
|
2018-10-18 18:48:21 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
if (process.env.FIREFOX_BIN)
|
|
|
|
baseConfig.browsers = ['FirefoxHeadless'];
|
2018-01-30 13:48:21 +00:00
|
|
|
|
2018-01-30 15:34:32 +00:00
|
|
|
config.set(baseConfig);
|
2017-08-25 06:42:53 +00:00
|
|
|
};
|