mermaid/karma.conf.js

62 lines
1.8 KiB
JavaScript
Raw Normal View History

2017-09-12 10:08:03 +02:00
import { puppeteer } from 'puppeteer/package.json'
import ChromiumDownloader from 'puppeteer/utils/ChromiumDownloader'
2017-09-10 13:41:34 +02:00
import { jsConfig } from './webpack.config.base'
2017-09-03 03:09:58 +02:00
2017-09-12 10:08:03 +02:00
process.env.CHROMIUM_BIN = ChromiumDownloader.revisionInfo(ChromiumDownloader.currentPlatform(), puppeteer.chromium_revision).executablePath
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: [
2017-09-12 09:50:58 +02:00
'./src/**/*.spec.js'
2017-04-11 16:14:25 +02:00
],
preprocessors: {
2017-09-12 10:08:03 +02:00
'src/**/*.spec.js': ['webpack', 'sourcemap']
2017-04-11 16:14:25 +02:00
},
webpack: {
2017-09-11 17:06:34 +02:00
node: webpackConfig.node,
2017-09-12 10:08:03 +02:00
module: webpackConfig.module,
devtool: 'inline-source-map'
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,
2017-04-16 18:12:30 +02:00
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
2017-09-12 10:08:03 +02:00
browsers: ['ChromiumHeadless'],
2017-09-12 09:50:58 +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
})
}