test: isolate server-context browser harness imports

This commit is contained in:
Peter Steinberger 2026-03-23 03:22:52 -07:00
parent 9d3d7f9e65
commit 2df10e81c8
No known key found for this signature in database
4 changed files with 20 additions and 0 deletions

View File

@ -1,6 +1,11 @@
import type { ChildProcessWithoutNullStreams } from "node:child_process";
import { EventEmitter } from "node:events";
import { afterEach, describe, expect, it, vi } from "vitest";
vi.hoisted(() => {
vi.resetModules();
});
import "./server-context.chrome-test-harness.js";
import * as chromeModule from "./chrome.js";
import type { RunningChrome } from "./chrome.js";

View File

@ -1,5 +1,10 @@
import fs from "node:fs";
import { afterEach, describe, expect, it, vi } from "vitest";
vi.hoisted(() => {
vi.resetModules();
});
import { createBrowserRouteContext } from "./server-context.js";
import type { BrowserServerState } from "./server-context.js";

View File

@ -1,4 +1,9 @@
import { afterEach, describe, expect, it, vi } from "vitest";
vi.hoisted(() => {
vi.resetModules();
});
import "./server-context.chrome-test-harness.js";
import * as chromeModule from "./chrome.js";
import { InvalidBrowserNavigationUrlError } from "./navigation-guard.js";

View File

@ -1,5 +1,10 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { withFetchPreconnect } from "../test-utils/fetch-mock.js";
vi.hoisted(() => {
vi.resetModules();
});
import "./server-context.chrome-test-harness.js";
import * as cdpModule from "./cdp.js";
import { InvalidBrowserNavigationUrlError } from "./navigation-guard.js";