-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathweb-test-runner.config.js
More file actions
42 lines (39 loc) · 1.09 KB
/
web-test-runner.config.js
File metadata and controls
42 lines (39 loc) · 1.09 KB
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
import { legacyPlugin } from '@web/dev-server-legacy';
import { vitePlugin } from '@remcovaes/web-test-runner-vite-plugin';
const filteredLogs = ['Running in dev mode', 'Lit is in dev mode'];
export default {
testsFinishTimeout: 10000,
/** Test files to run */
files: [
'src/**/*.test.js',
],
nodeResolve: true,
/** Filter out lit dev mode logs */
filterBrowserLogs(log) {
for (const arg of log.args) {
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
return false;
}
}
return true;
},
plugins: [
vitePlugin(),
// make sure this plugin is always last
legacyPlugin({
polyfills: {
webcomponents: true,
// Inject lit's polyfill-support module into test files, which is required
// for interfacing with the webcomponents polyfills
custom: [
{
name: 'lit-polyfill-support',
path: 'node_modules/lit/polyfill-support.js',
test: "!('attachShadow' in Element.prototype)",
module: false,
},
],
},
}),
],
};