test: keep stateful tests out of unit-fast

This commit is contained in:
Peter Steinberger
2026-04-27 17:34:05 +01:00
parent be0c1a9835
commit aeba1d6b47
3 changed files with 6 additions and 5 deletions

View File

@@ -59,6 +59,7 @@ describe("debug proxy runtime", () => {
});
afterEach(() => {
finalizeDebugProxyCapture();
globalThis.fetch = originalFetch;
for (const key of envKeys) {
const value = savedEnv[key];
@@ -71,7 +72,7 @@ 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;
globalThis.fetch = vi.fn(async () => new Response("{}", { status: 200 })) as typeof fetch;
initializeDebugProxyCapture("test");
await globalThis.fetch("https://api.minimax.io/anthropic/messages", {
@@ -79,6 +80,7 @@ describe("debug proxy runtime", () => {
headers: { "content-type": "application/json" },
body: '{"input":"hello"}',
});
await new Promise((resolve) => setImmediate(resolve));
finalizeDebugProxyCapture();
const events = storeState.events.filter((event) => event.sessionId === "runtime-test-session");

View File

@@ -43,7 +43,9 @@ describe("unit-fast vitest lane", () => {
it("keeps obvious stateful files out of the unit-fast lane", () => {
expect(isUnitFastTestFile("src/plugin-sdk/temp-path.test.ts")).toBe(false);
expect(isUnitFastTestFile("src/agents/sandbox.resolveSandboxContext.test.ts")).toBe(false);
expect(isUnitFastTestFile("src/tts/tts-config.test.ts")).toBe(false);
expect(isUnitFastTestFile("src/crestodian/overview.test.ts")).toBe(false);
expect(isUnitFastTestFile("src/proxy-capture/runtime.test.ts")).toBe(false);
expect(isUnitFastTestFile("src/security/windows-acl.test.ts")).toBe(false);
expect(resolveUnitFastTestIncludePattern("src/plugin-sdk/temp-path.ts")).toBeNull();
expect(classifyUnitFastTestFileContent("vi.resetModules(); await import('./x.js')")).toEqual([
"module-mocking",

View File

@@ -68,7 +68,6 @@ export const forcedUnitFastTestFiles = [
"src/acp/server.startup.test.ts",
"src/acp/translator.session-rate-limit.test.ts",
"src/browser-lifecycle-cleanup.test.ts",
"src/crestodian/overview.test.ts",
"src/crestodian/crestodian.test.ts",
"src/crestodian/operations.test.ts",
"src/crestodian/rescue-message.test.ts",
@@ -96,7 +95,6 @@ export const forcedUnitFastTestFiles = [
"src/pairing/allow-from-store-read.test.ts",
"src/pairing/pairing-store.test.ts",
"src/plugin-sdk/memory-host-events.test.ts",
"src/proxy-capture/runtime.test.ts",
"src/proxy-capture/store.sqlite.test.ts",
"src/security/audit-exec-surface.test.ts",
"src/security/audit-extra.async.test.ts",
@@ -106,7 +104,6 @@ export const forcedUnitFastTestFiles = [
"src/security/external-content.test.ts",
"src/security/fix.test.ts",
"src/security/skill-scanner.test.ts",
"src/security/windows-acl.test.ts",
"src/realtime-transcription/websocket-session.test.ts",
"src/routing/resolve-route.test.ts",
"src/trajectory/export.test.ts",