From fffb7d3d7a9e14f537d20fb443842126466a8bfc Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 20 Apr 2026 21:02:13 +0100 Subject: [PATCH] perf(test): avoid proxy runtime dynamic import --- src/proxy-capture/runtime.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/proxy-capture/runtime.test.ts b/src/proxy-capture/runtime.test.ts index e62d14f11e3..bb6247341e1 100644 --- a/src/proxy-capture/runtime.test.ts +++ b/src/proxy-capture/runtime.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { finalizeDebugProxyCapture, initializeDebugProxyCapture } from "./runtime.js"; const storeState = vi.hoisted(() => { const events: Record[] = []; @@ -68,14 +69,13 @@ describe("debug proxy runtime", () => { it("captures ambient global fetch calls when debug proxy mode is enabled", async () => { globalThis.fetch = vi.fn(async () => ({ status: 200 }) as Response) as typeof fetch; - const runtime = await import("./runtime.js"); - runtime.initializeDebugProxyCapture("test"); + initializeDebugProxyCapture("test"); await globalThis.fetch("https://api.minimax.io/anthropic/messages", { method: "POST", headers: { "content-type": "application/json" }, body: '{"input":"hello"}', }); - runtime.finalizeDebugProxyCapture(); + finalizeDebugProxyCapture(); const events = storeState.events.filter((event) => event.sessionId === "runtime-test-session"); expect(events.some((event) => event.host === "api.minimax.io")).toBe(true);