-
Notifications
You must be signed in to change notification settings - Fork 2
/
karma.conf.js
46 lines (42 loc) · 1.31 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
/* eslint-disable import/no-extraneous-dependencies */
const { createDefaultConfig } = require('@open-wc/testing-karma');
const json = require('es-dev-server-import-json');
const cjsTransformer = require('es-dev-commonjs-transformer');
const merge = require('deepmerge');
module.exports = config => {
const defaultConfig = createDefaultConfig(config);
config.set(
merge(defaultConfig, {
files: [
// runs all files ending with .test in the test folder,
// can be overwritten by passing a --grep flag. examples:
//
// npm run test -- --grep test/foo/bar.test.js
// npm run test -- --grep test/bar/*
{ pattern: config.grep ? config.grep : 'dist/**/test/**/*.test.js', type: 'module' },
],
esm: {
plugins: [
json(),
],
responseTransformers: [
cjsTransformer([
...defaultConfig.esm.babelModernExclude,
'**/node_modules/@open-wc/**/*',
'**/node_modules/chai/**/*',
'**/node_modules/chai-dom/**/*',
'**/node_modules/sinon-chai/**/*',
])
],
nodeResolve: true,
},
coverageIstanbulReporter: {
thresholds: {
emitWarning: true,
},
},
browserNoActivityTimeout: 60000,
}),
);
return config;
};