Skip to content

Commit

Permalink
[CI] update karma config for test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Cui committed Mar 6, 2018
1 parent 591510a commit 8e4040c
Showing 1 changed file with 19 additions and 25 deletions.
44 changes: 19 additions & 25 deletions tasks/config/karma.conf.js
@@ -1,27 +1,32 @@
var pathUtil = require('../utils/path.util');
/** Created by CUIJA on 2017-09-27.*/

var webpackTestConfig = require('./webpack.test.config');
var pathUtil = require('../utils/path.util');

var puppeteer = require('puppeteer');

process.env.CHROMIUM_BIN = puppeteer.executablePath();
process.env.CHROME_BIN = puppeteer.executablePath();


module.exports = function(config) {
config.set({
logLevel: config.LOG_DEBUG,
customLaunchers: {
ChromiumHeadlessNoSandbox: {
base: 'ChromiumHeadless',
flags: ['--no-sandbox']
}
},
browsers: [
'ChromiumHeadlessNoSandbox'
],
useIframe: true,
runInParent: false,
plugins: [
'karma-chrome-launcher',
'karma-chai',
'karma-mocha',
'karma-spec-reporter',
'karma-coverage',
'karma-coverage-istanbul-reporter',
'karma-sourcemap-loader',
'karma-spec-reporter',
'karma-sinon',
'karma-webpack',
'karma-jawr'
Expand All @@ -33,8 +38,6 @@ module.exports = function(config) {
'chai'
],
files: [
pathUtil.resolve('src/main/webapp/js/vendor/ext') + '/ext-base.js',
pathUtil.resolve('src/main/webapp/js/vendor/ext') + '/ext-all.js',
pathUtil.resolve('src/test/js/unit/specs') + '/**/*.spec.js'
],
reporters: [
Expand All @@ -45,19 +48,21 @@ module.exports = function(config) {
'/**/*.spec.js': ['webpack', 'sourcemap']
},
jawr: {
configLocation: pathUtil.resolve('src/main/resources/jawr') + '/jawr.properties',
configLocation: pathUtil.resolve('src/main/resources/jawr/') + 'jawr.properties',
webappLocation: pathUtil.resolve('src/main/webapp'),
targetLocation: pathUtil.resolve('src/test/js/build'),
localeConfigLocation: pathUtil.resolve('src/main/resources')
},
webpack: webpackTestConfig,
webpackMiddleware: {
stats: 'errors-only',
noInfo: true
},
coverageIstanbulReporter: {
dir: pathUtil.resolve('src/test/js/unit') + '/coverage',
reports: [
'lcovonly',
'text-summary'
],
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true,
skipFilesWithNoCoverage: false,
skipFilesWithNoCoverage: true,
thresholds: {
emitWarning: false,
global: {
Expand All @@ -67,17 +72,6 @@ module.exports = function(config) {
functions: 1
}
}
},
webpack: webpackTestConfig,
webpackMiddleware: {
stats: 'errors-only',
noInfo: true
},
customLaunchers: {
ChromiumHeadlessNoSandbox: {
base: 'ChromiumHeadless',
flags: ['--no-sandbox']
}
}
});
};

0 comments on commit 8e4040c

Please sign in to comment.