mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-17 12:50:44 +00:00
29 lines
856 B
TypeScript
29 lines
856 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
OPENCLAW_DEBUG_PROXY_ENABLED,
|
|
OPENCLAW_DEBUG_PROXY_SESSION_ID,
|
|
resolveDebugProxySettings,
|
|
} from "./env.js";
|
|
|
|
describe("resolveDebugProxySettings", () => {
|
|
it("keeps an implicit debug proxy session id stable within one process", () => {
|
|
const env = {
|
|
[OPENCLAW_DEBUG_PROXY_ENABLED]: "1",
|
|
} satisfies NodeJS.ProcessEnv;
|
|
|
|
const first = resolveDebugProxySettings(env);
|
|
const second = resolveDebugProxySettings(env);
|
|
|
|
expect(first.sessionId).toBe(second.sessionId);
|
|
});
|
|
|
|
it("prefers an explicit session id from the environment", () => {
|
|
const settings = resolveDebugProxySettings({
|
|
[OPENCLAW_DEBUG_PROXY_ENABLED]: "1",
|
|
[OPENCLAW_DEBUG_PROXY_SESSION_ID]: "session-explicit",
|
|
});
|
|
|
|
expect(settings.sessionId).toBe("session-explicit");
|
|
});
|
|
});
|