-
Notifications
You must be signed in to change notification settings - Fork 6
/
karma.conf.js
64 lines (62 loc) · 1.95 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
const { createDefaultConfig } = require('@open-wc/testing-karma');
const merge = require('deepmerge');
module.exports = config => {
// merging our stuff into default config
const defaultConfig = createDefaultConfig(config);
const extendedDefaultConfig = merge(defaultConfig, {
files: [
{ pattern: config.grep ? config.grep : '{common,components}/*/test/**/*.test.js', type: 'module' },
{ pattern: 'common/design-tokens/build/**/*.scss', included: false },
{ pattern: require.resolve('chai-spies/chai-spies.js'), included: true, watch: false, type: 'js' }
],
preprocessors: {
'common/design-tokens/build/scss/schemes/**/*.scss': ['file-fixtures']
},
esm: {
nodeResolve: true,
},
frameworks: ['chai'],
reporters: ['karmaHTML'],
browserDisconnectTimeout: 300000,
browserNoActivityTimeout: 360000,
singleRun: true,
autoWatch: false,
restartOnFileChange: true,
captureTimeout: 420000,
client: {
karmaHTML: {
source: [
{ tag: 'contextSetupTest', src: 'common/context/test/context-setup.test.html' },
{ tag: 'coreSetupTest', src: 'common/core/test/core-setup.test.html' },
{ tag: 'fontsSetupTest', src: 'common/fonts/test/fonts-setup.test.html' },
{ tag: 'schemeSetupTest', src: 'common/scheme/test/scheme-setup.test.html' },
{ tag: 'drawerSetupTest', src: 'components/drawer/test/drawer-setup.test.html' },
]
}
},
coverageReporter: {
dir: `coverage/`,
reporters: [
{
type: 'cobertura', subdir: 'report-cobertura', file: 'coverage.xml'
},
{
type: 'lcovonly', subdir: 'report-lcov', file: 'lcov.info'
}
]
},
customLaunchers: {
Safari_13_BS: {
base: 'BrowserStack',
browser: 'safari',
browser_version: '13.1',
os: 'OS X',
os_version: 'Catalina'
}
},
browsers: ['Safari_13_BS'],
listenAddress: '::', // See https://github.com/karma-runner/karma/issues/3730#issuecomment-1122075632
});
config.set(extendedDefaultConfig);
return config;
};