-
Notifications
You must be signed in to change notification settings - Fork 4
/
web-test-runner.config.js
56 lines (52 loc) · 1.48 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
46
47
48
49
50
51
52
53
54
55
56
import { fileURLToPath } from "url";
import { playwrightLauncher } from "@web/test-runner-playwright";
import { esbuildPlugin } from "@web/dev-server-esbuild";
import { fromRollup } from "@web/dev-server-rollup";
import rollupCommonjs from "@rollup/plugin-commonjs";
import rollupReplace from "@rollup/plugin-replace";
import litCssPlugin from "rollup-plugin-lit-css";
const commonjs = fromRollup(rollupCommonjs);
const litcss = fromRollup(litCssPlugin);
const replace = fromRollup(rollupReplace);
const filteredLogs = ["Running in dev mode", "Lit is in dev mode"];
export default {
files: "src/**/*.test.ts",
nodeResolve: true,
concurrentBrowsers: 3,
mimeTypes: {
// Serve .css files as a js module.
"**/*.css": "js",
},
browsers: [
playwrightLauncher({ product: "chromium" }),
playwrightLauncher({ product: "webkit" }),
playwrightLauncher({ product: "firefox" }),
],
plugins: [
commonjs({
include: [
// Fix no 'default export' error for sdp which is used by the webrtc-adapter.
"**/node_modules/sdp/**/*",
],
}),
esbuildPlugin({
ts: true,
tsconfig: fileURLToPath(new URL("./tsconfig.json", import.meta.url))
}),
replace({
preventAssignment: true,
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
}),
litcss({
include: ["src/component/**/*.css"]
}),
],
filterBrowserLogs(log) {
for (const arg of log.args) {
if (typeof arg === "string" && filteredLogs.some(l => arg.includes(l))) {
return false;
}
}
return true;
},
};