-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb-dev-server.config.mjs
More file actions
36 lines (34 loc) · 1.14 KB
/
Copy pathweb-dev-server.config.mjs
File metadata and controls
36 lines (34 loc) · 1.14 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
import { chromeLauncher } from "@web/test-runner-chrome";
import fs from "fs";
// In manual mode the flag keeps the browser open across shadow hot-reloads
// instead of the session completing and killing it.
const SKIP_COMPLETING = !!process.env.RHIZOME__SKIP_COMPLETING_TEST_RUNNER;
export default {
rootDir: "test/browser",
testRunnerHtml: () => {
const html = fs.readFileSync(
"./test/browser/test-runner-index.html",
"utf8",
);
if (SKIP_COMPLETING) {
return html.replace(
/RHIZOME__SKIP_COMPLETING_TEST_RUNNER:\s*false/,
"RHIZOME__SKIP_COMPLETING_TEST_RUNNER: true",
);
}
return html;
},
// Options must go under launchOptions; chromeLauncher ignores unknown
// top-level keys silently (the old repo's `headless: false` never worked).
browsers: [
chromeLauncher({
launchOptions: {
headless: !process.env.RHIZOME__HEADED,
},
}),
],
nodeResolve: true,
debug: false,
browserLogs: true,
files: ["test/browser/browser-tests/**/*_test.js"],
};