2014-11-04 07:50:58 +01:00
|
|
|
// Karma configuration
|
|
|
|
// Generated on Mon Nov 03 2014 07:53:38 GMT+0100 (CET)
|
|
|
|
|
2017-09-03 09:09:58 +08:00
|
|
|
import { webConfig } from './webpack.config.base.js'
|
|
|
|
|
2017-09-03 09:50:25 +08:00
|
|
|
const webpackConfig = webConfig()
|
|
|
|
|
2014-11-04 07:50:58 +01:00
|
|
|
module.exports = function (config) {
|
2017-04-11 22:14:25 +08:00
|
|
|
config.set({
|
2014-11-04 07:50:58 +01:00
|
|
|
|
2017-04-17 00:12:30 +08:00
|
|
|
// base path that will be used to resolve all patterns (eg. files, exclude)
|
2017-04-11 22:14:25 +08:00
|
|
|
basePath: '.',
|
2014-11-04 07:50:58 +01:00
|
|
|
|
2017-04-17 00:12:30 +08:00
|
|
|
// frameworks to use
|
|
|
|
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
2017-04-18 23:20:38 +08:00
|
|
|
frameworks: ['jasmine'],
|
2014-11-04 07:50:58 +01:00
|
|
|
|
2017-04-17 00:12:30 +08:00
|
|
|
// list of files / patterns to load in the browser
|
2017-04-11 22:14:25 +08:00
|
|
|
files: [
|
|
|
|
'./src/*.spec.js',
|
|
|
|
'./src/diagrams/flowchart/**/*.spec.js',
|
|
|
|
'./src/diagrams/example/**/*.spec.js',
|
|
|
|
'./src/diagrams/sequenceDiagram/**/*.spec.js',
|
|
|
|
'./src/diagrams/classDiagram/**/*.spec.js',
|
|
|
|
'./src/diagrams/gantt/**/*.spec.js',
|
|
|
|
'./src/diagrams/gitGraph/**/*.spec.js'
|
|
|
|
],
|
|
|
|
|
|
|
|
preprocessors: {
|
2017-04-18 23:20:38 +08:00
|
|
|
'src/**/*.spec.js': ['webpack']
|
2017-04-11 22:14:25 +08:00
|
|
|
},
|
2014-11-04 07:50:58 +01:00
|
|
|
|
2017-04-18 23:20:38 +08:00
|
|
|
webpack: {
|
2017-09-03 09:50:25 +08:00
|
|
|
externals: webpackConfig.externals,
|
|
|
|
module: webpackConfig.module
|
2017-04-11 22:14:25 +08:00
|
|
|
},
|
2014-11-04 07:50:58 +01:00
|
|
|
|
2017-04-17 00:12:30 +08:00
|
|
|
// test results reporter to use
|
|
|
|
// possible values: 'dots', 'progress'
|
|
|
|
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
2017-04-11 22:14:25 +08:00
|
|
|
reporters: ['dots'],
|
2014-11-04 07:50:58 +01:00
|
|
|
|
2017-04-17 00:12:30 +08:00
|
|
|
// web server port
|
2017-04-11 22:14:25 +08:00
|
|
|
port: 9876,
|
2014-11-04 07:50:58 +01:00
|
|
|
|
2017-04-17 00:12:30 +08:00
|
|
|
// enable / disable colors in the output (reporters and logs)
|
2017-04-11 22:14:25 +08:00
|
|
|
colors: true,
|
2014-11-04 07:50:58 +01:00
|
|
|
|
2017-04-17 00:12:30 +08:00
|
|
|
// level of logging
|
|
|
|
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
2017-04-11 22:14:25 +08:00
|
|
|
logLevel: config.LOG_INFO,
|
2014-11-04 07:50:58 +01:00
|
|
|
|
2017-04-17 00:12:30 +08:00
|
|
|
// enable / disable watching file and executing tests whenever any file changes
|
2017-04-11 22:14:25 +08:00
|
|
|
autoWatch: true,
|
2014-11-04 07:50:58 +01:00
|
|
|
|
2017-04-18 22:14:02 +08:00
|
|
|
customLaunchers: {
|
2017-04-21 10:25:16 +08:00
|
|
|
ChromeHeadless: {
|
|
|
|
base: 'Chrome',
|
2017-04-18 22:14:02 +08:00
|
|
|
flags: [
|
2017-04-24 22:42:07 +08:00
|
|
|
'--incognito',
|
2017-05-31 20:58:50 +08:00
|
|
|
// '--headless',
|
2017-04-18 22:14:02 +08:00
|
|
|
'--disable-gpu',
|
2017-04-24 23:00:51 +08:00
|
|
|
'--no-sandbox',
|
2017-04-18 22:14:02 +08:00
|
|
|
// Without a remote debugging port, Google Chrome exits immediately.
|
|
|
|
'--remote-debugging-port=9222'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-04-17 00:12:30 +08:00
|
|
|
// start these browsers
|
|
|
|
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
2017-04-21 10:25:16 +08:00
|
|
|
browsers: ['ChromeHeadless'],
|
2017-04-11 22:14:25 +08:00
|
|
|
plugins: [
|
|
|
|
'karma-jasmine',
|
2017-04-18 22:14:02 +08:00
|
|
|
'karma-chrome-launcher',
|
2017-04-18 23:35:52 +08:00
|
|
|
'karma-webpack'
|
2017-04-11 22:14:25 +08:00
|
|
|
],
|
2017-04-17 00:12:30 +08:00
|
|
|
// Continuous Integration mode
|
|
|
|
// if true, Karma captures browsers, runs the tests and exits
|
2017-04-11 22:14:25 +08:00
|
|
|
singleRun: false
|
|
|
|
})
|
|
|
|
}
|