-
Notifications
You must be signed in to change notification settings - Fork 59
/
karma.conf.js
51 lines (47 loc) · 1.53 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
/*
This config is based on:
- https://vue-test-utils.vuejs.org/installation/#using-other-test-runners
- https://github.com/eddyerburgh/vue-test-utils-karma-example
- https://github.com/eddyerburgh/avoriaz-karma-mocha-example
- https://github.com/Nikku/karma-browserify
*/
// eslint-disable-next-line import/extensions
const webpackConfig = require('./node_modules/@vue/cli-service/webpack.config.js');
const { entry, ...webpackConfigForKarma } = webpackConfig;
webpackConfigForKarma.devtool = 'inline-source-map';
// See additional warning information.
webpackConfigForKarma.stats = {
...webpackConfigForKarma.stats,
children: true,
errorDetails: true
};
module.exports = (config) => {
config.set({
frameworks: ['webpack', 'mocha'],
files: [
'test/index.js',
{ pattern: 'public/fonts/icomoon.ttf', served: true, included: false },
{ pattern: 'public/images/*', served: true, included: false },
{ pattern: 'public/blank.html', served: true, included: false },
{ pattern: 'test/files/*', served: true, included: false }
],
proxies: {
'/fonts/': '/base/public/fonts/',
'/blank.html': '/base/public/blank.html',
'/test/files/': '/base/test/files/'
},
preprocessors: {
'test/index.js': ['webpack', 'sourcemap']
},
webpack: webpackConfigForKarma,
browsers: ['ChromeHeadless'],
reporters: ['spec'],
singleRun: true,
customLaunchers: {
ChromeDebugging: {
base: 'Chrome',
flags: ['--remote-debugging-port=8333']
}
}
});
};