Launches a browser for the given config.browser type.
For chromium: connects via CDP to the pre-launched Chrome (fast path) or falls
back to chromium.launch() if pre-launch failed.
For firefox/webkit: uses playwright's standard launch (requires npx playwright install [browser]).
Launches a Playwright browser (or reuses an existing one), starts the web server, and returns the page/server/browser connection object.
The three fields launch actually reads. Narrower than Config on purpose: qunitx run
has a config of its own with no test files in it, and asking it to fake thirty unrelated fields
to borrow the CDP pre-launch fast path would be a cast pretending to be a type.
-
browser: "chromium" | "firefox" | "webkit"
Engine to launch. Defaults to chromium when absent.
-
open: boolean | string
--open:trueasks for a visible window (honoured together withwatch). -
watch: boolean
--watch: keeps firefox/webkit headed whenopenis also set.
Usage
import * as mod from "lib/setup/browser.ts";