2016-11-19 20:22:57 +05:30
|
|
|
/* eslint-env node */
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-08-09 12:23:05 +05:30
|
|
|
// https://docs.gitlab.com/ce/ci/variables/README.html
|
|
|
|
// noinspection Eslint
|
|
|
|
const isCi = typeof process.env.CI !== 'undefined';
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-08-09 12:23:05 +05:30
|
|
|
module.exports = function(config) {
|
|
|
|
const params = {
|
2016-06-01 10:29:15 +05:30
|
|
|
// base path that will be used to resolve all patterns (eg. files, exclude)
|
|
|
|
basePath: '',
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
// frameworks to use
|
|
|
|
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
2016-07-30 16:14:43 +05:30
|
|
|
frameworks: ['mocha', 'sinon'],
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
// list of files / patterns to load in the browser
|
|
|
|
files: [
|
2016-11-27 17:27:11 +05:30
|
|
|
'dll/vendor.dll.js',
|
2017-05-26 01:22:00 +05:30
|
|
|
'src/test.js'
|
2016-06-01 10:29:15 +05:30
|
|
|
],
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
// list of files to exclude
|
|
|
|
exclude: [
|
|
|
|
],
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
// preprocess matching files before serving them to the browser
|
|
|
|
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
|
|
|
preprocessors: {
|
2017-05-26 01:22:00 +05:30
|
|
|
'src/test.js': ['webpack', 'sourcemap']
|
2016-06-01 10:29:15 +05:30
|
|
|
},
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
webpack: require('./webpack.config.js'),
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
webpackServer: {
|
2016-07-30 16:14:43 +05:30
|
|
|
noInfo: true // please don't spam the console when running in karma!
|
2016-06-01 10:29:15 +05:30
|
|
|
},
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
// test results reporter to use
|
|
|
|
// possible values: 'dots', 'progress'
|
|
|
|
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
|
|
|
reporters: ['nyan'],
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-07-30 16:14:43 +05:30
|
|
|
nyanReporter: {
|
|
|
|
// suppress the red background on errors in the error
|
|
|
|
// report at the end of the test run
|
|
|
|
suppressErrorHighlighting: true
|
|
|
|
},
|
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
// web server port
|
|
|
|
port: 9876,
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
// enable / disable colors in the output (reporters and logs)
|
|
|
|
colors: true,
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
// level of logging
|
|
|
|
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
|
|
|
logLevel: config.LOG_INFO,
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
// enable / disable watching file and executing tests whenever any file changes
|
|
|
|
autoWatch: true,
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
// start these browsers
|
|
|
|
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
2016-12-04 17:41:23 +05:30
|
|
|
browsers: ['jsdom'],
|
2016-01-03 01:54:07 +05:30
|
|
|
|
2016-06-01 10:29:15 +05:30
|
|
|
// Continuous Integration mode
|
|
|
|
// if true, Karma captures browsers, runs the tests and exits
|
|
|
|
singleRun: false
|
2016-08-09 12:23:05 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
if (isCi) {
|
2016-11-19 20:22:57 +05:30
|
|
|
Object.assign(params, {
|
|
|
|
reporters: ['dots'],
|
|
|
|
autoWatch: false,
|
|
|
|
singleRun: true,
|
|
|
|
client: {
|
|
|
|
captureConsole: false
|
|
|
|
}
|
|
|
|
});
|
2016-08-09 12:23:05 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
config.set(params);
|
2016-01-03 01:54:07 +05:30
|
|
|
};
|