redoc/karma.conf.js

59 lines
1.4 KiB
JavaScript
Raw Normal View History

module.exports = function(config) {
2016-08-28 21:46:10 +03:00
const testWebpackConfig = require('./build/webpack.test.js');
const travis = process.env.TRAVIS;
2015-12-10 00:46:27 +03:00
2016-08-28 21:46:10 +03:00
config.set({
frameworks: ['jasmine', 'sinon', 'should'],
2016-08-28 21:46:10 +03:00
preprocessors: {
'./tests/spec-bundle.js': ['coverage', 'webpack', 'sourcemap'],
2016-08-28 21:46:10 +03:00
},
2015-12-10 00:46:27 +03:00
2016-08-28 21:46:10 +03:00
coverageReporter: {
type: 'in-memory',
},
remapCoverageReporter: {
'text-summary': null,
'text-lcov': './coverage/lcov.info',
html: './coverage/html',
2016-08-28 21:46:10 +03:00
},
webpack: testWebpackConfig,
2016-08-29 00:40:56 +03:00
webpackMiddleware: {
2016-08-29 12:05:44 +03:00
stats: 'errors-only',
state: true,
2016-08-29 00:40:56 +03:00
},
2016-08-28 21:46:10 +03:00
client: {
chai: {
truncateThreshold: 0,
},
2016-08-28 21:46:10 +03:00
},
files: [
{ pattern: './tests/spec-bundle.js', watched: false },
{ pattern: 'tests/schemas/**/*.json', included: false },
{ pattern: 'tests/schemas/**/*.yml', included: false },
{ pattern: 'lib/**/*.html', included: false },
],
2015-12-10 00:46:27 +03:00
2016-08-28 21:46:10 +03:00
proxies: {
'/tests/schemas': '/base/tests/schemas',
'/lib/': '/base/lib/',
'/node_modules/': '/base/node_modules/',
2016-08-28 21:46:10 +03:00
},
colors: true,
singleRun: true,
reporters: travis
? ['mocha', 'coverage', 'remap-coverage', 'coveralls']
: ['mocha', 'coverage', 'remap-coverage'],
2015-12-10 00:46:27 +03:00
browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
},
2015-12-10 00:46:27 +03:00
browserNoActivityTimeout: 60000,
2016-08-28 21:46:10 +03:00
});
};