mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:10:44 +00:00
test: keep stateful tests out of unit-fast
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user