-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma.conf.js
48 lines (42 loc) · 1.19 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
const { createDefaultConfig } = require('@open-wc/testing-karma');
const merge = require('deepmerge');
module.exports = config => {
config.set(
merge(createDefaultConfig(config), {
files: [
'./karma-variables.js',
{ pattern: 'src/*.js', type: 'module' },
{ pattern: 'src/**/*.js', type: 'module' },
{ pattern: config.grep ? config.grep : 'test/*.test.js', type: 'module' },
],
coverageReporter: {
dir: 'coverage',
reporters: [
{ type: 'html', subdir: 'report-html' },
{ type: 'text', subdir: '.' },
{ type: 'lcov', subdir: '.' },
],
},
plugins: [
// load plugin
require.resolve('@open-wc/karma-esm'),
'karma-*',
],
frameworks: ['esm'],
esm: {
// if you are using 'bare module imports' you will need this option
nodeResolve: true,
},
plugins: ['karma-threshold-reporter'],
reporters: ['progress', 'coverage', 'threshold'],
// the configure thresholds
thresholdReporter: {
statements: 50,
branches: 30,
functions: 50,
lines: 50,
},
}),
);
return config;
};