forked from getodk/central-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
39 lines (35 loc) · 1.23 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
/*
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';
module.exports = (config) => {
config.set({
frameworks: ['mocha'],
files: [
'test/index.js',
{ pattern: 'public/fonts/icomoon.ttf', 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',
'/v1/backup': '/base/public/blank.html',
'/test/files/': '/base/test/files/'
},
preprocessors: {
'test/index.js': ['webpack', 'sourcemap']
},
webpack: webpackConfigForKarma,
browsers: ['ChromeHeadless'],
reporters: ['spec'],
singleRun: true
});
};