-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb-test-runner.config.js
45 lines (42 loc) · 1.29 KB
/
web-test-runner.config.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
import { vitePlugin } from "@remcovaes/web-test-runner-vite-plugin";
import { playwrightLauncher } from "@web/test-runner-playwright";
import { defaultReporter } from "@web/test-runner";
import { junitReporter } from "@web/test-runner-junit-reporter";
const LOG_FILTER = ["Lit is in dev mode", "[vite] connecting..."];
const getBrowser = (product) =>
playwrightLauncher({
product,
createBrowserContext: ({ browser }) => {
return browser.newContext({ permissions: ["clipboard-read"] });
},
});
export default {
coverage: true,
coverageConfig: {
include: ["src/**/*.{ts,tsx}", "src/**/**/*.{ts,tsx}"],
},
files: ["src/test/**/*.js", "src/test/**/*.ts", "src/index.js"],
nodeResolve: true,
plugins: [vitePlugin()],
browsers: [getBrowser("chromium")],
filterBrowserLogs: ({ args }) => {
return !args.some((log) => {
return (
typeof log === "string" &&
LOG_FILTER.some((filterTerm) => log.includes(filterTerm))
);
});
},
testFramework: {
config: {
timeout: 1000,
},
},
reporters: [
defaultReporter({ reportTestResults: false, reportTestProgress: true }),
junitReporter({
outputPath: "src/test/test-results.xml", // default `'./test-results.xml'`
reportLogs: true, // default `false`
}),
],
};