-
Notifications
You must be signed in to change notification settings - Fork 11
/
karma.conf.js
34 lines (30 loc) · 1.14 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
/* eslint-disable import/no-extraneous-dependencies */
const { createDefaultConfig } = require('@open-wc/testing-karma');
const merge = require('deepmerge');
// Run the tests headless by doing `npm run test --headless`
const headless = process.env.npm_config_headless;
module.exports = config => {
config.set(
merge(createDefaultConfig(config), {
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 : 'test/**/*.test.js', type: 'module' },
],
esm: {
nodeResolve: true,
},
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 60000,
flags: ['--disable-web-security', '--disable-gpu', '--no-sandbox'],
// you can overwrite/extend the config further
// In headless mode (ie. CI), do not open a browser. The default will suffice
...(headless ? {} : { browsers: ['Chrome'] }),
}),
);
return config;
};