-
Notifications
You must be signed in to change notification settings - Fork 3
/
karma.conf.js
70 lines (54 loc) · 1.92 KB
/
karma.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const webpackConfig = require('./node_modules/@vue/cli-service/webpack.config.js')
module.exports = function(config) {
config.set({
// Base path for all patterns (eg. files, exclude)
basePath: '',
// Test frameworks (https://npmjs.org/browse/keyword/karma-adapter)
frameworks: ['mocha', 'chai'],
// Files to load into the browser (including required() files)
files: [
'tests/unit/**/*.spec.js',
],
// Excluded files
exclude: [
],
// Files to preprocess before being served (including required() files)
// (https://npmjs.org/browse/keyword/karma-preprocessor)
preprocessors: {
'tests/unit/**/*.js': ['webpack'],
'**/*.js': ['sourcemap'],
},
webpack: {
...webpackConfig,
entry: undefined, // use preprocessed files as entry points
devtool: 'inline-source-map',
},
webpackMiddleware: {
noInfo: true,
stats: 'errors-only',
},
// Test result reporters (https://npmjs.org/browse/keyword/karma-reporter)
reporters: ['mocha'],
// Web server port
port: 9876,
// Show colors in reporter and log output
colors: true,
// Log level: config.{LOG_DISABLE,LOG_ERROR,LOG_WARN,LOG_INFO,LOG_DEBUG}
logLevel: config.LOG_INFO,
// Watch files and execute tests on change
autoWatch: false,
// Launch these browsers (https://npmjs.org/browse/keyword/karma-launcher)
browsers: [
// 'Chrome',
// 'Chromium',
// 'Firefox',
// 'ChromeHeadless',
'ChromiumHeadless',
// 'FirefoxHeadless',
],
// Exit after running the tests
singleRun: true,
// Number of browsers to be launched simultaneously
concurrency: Infinity,
})
}