CI / install (pull_request) Successful in 8m10s
CI / lint (pull_request) Successful in 3m7s
CI / format (pull_request) Successful in 3m8s
CI / typecheck (pull_request) Successful in 3m39s
CI / typetest (pull_request) Successful in 3m22s
CI / browser-tests (pull_request) Successful in 5m49s
CI / node-tests (pull_request) Successful in 1m22s
Co-Authored-By: gpt-5.6-sol <noreply@openai.com>
@webnet/browser-test-utils
Shared Playwright utilities for browser integration tests.
This is a private workspace, not a published library: it is used only by this repo's own node:test suites that need a real browser. forBrowsers wraps a test body in a node:test suite per configured browser (Chromium and Firefox), launching a headless Browser in before and closing it in after, and hands the test a BrowserTestContext with newPage() and serve(dir). newPage() injects an __name shim into the page, working around tsx's esbuild keepNames output losing function names when page.evaluate() serializes callbacks via toString(). serve(dir) starts a local static file server (TestServer) rooted at dir, rejecting paths that escape it.
Usage
import { forBrowsers } from "@webnet/browser-test-utils"
forBrowsers(({ browserName, newPage, serve }) => {
test(`loads in ${browserName}`, async () => {
const server = await serve("dist")
const page = await newPage()
await page.goto(server.url)
await server.close()
})
})
See also
@webnet/test-app— one of the apps commonly served under test viaserve()