mermaid/karma.conf.js

83 lines
2.2 KiB
JavaScript
Raw Normal View History

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