




















@@ -94,25 +94,26 @@ describe("modelsAuthListCommand", () => {
9494cfg: {},
9595provider: "openai-codex",
9696});
97-expect(runtime.jsonPayloads).toHaveLength(1);
97+expect(runtime.jsonPayloads).toStrictEqual([
98+expect.objectContaining({
99+agentDir: "/tmp/openclaw/agents/coder",
100+agentId: "coder",
101+authStatePath: "/tmp/openclaw/agents/coder/auth-state.json",
102+profiles: [
103+{
104+cooldownUntil: "2027-01-15T08:00:10.000Z",
105+email: "user@example.com",
106+expiresAt: "2027-01-15T08:00:00.000Z",
107+id: "openai-codex:user@example.com",
108+label: "openai-codex:user@example.com",
109+provider: "openai-codex",
110+type: "oauth",
111+},
112+],
113+provider: "openai-codex",
114+}),
115+]);
98116expect(JSON.stringify(runtime.jsonPayloads[0])).not.toContain("secret");
99-const payload = runtime.jsonPayloads[0] as
100-| {
101-agentId?: unknown;
102-provider?: unknown;
103-profiles?: Array<Record<string, unknown>>;
104-}
105-| undefined;
106-expect(payload?.agentId).toBe("coder");
107-expect(payload?.provider).toBe("openai-codex");
108-expect(payload?.profiles).toHaveLength(1);
109-const [profile] = payload?.profiles ?? [];
110-expect(profile?.id).toBe("openai-codex:user@example.com");
111-expect(profile?.provider).toBe("openai-codex");
112-expect(profile?.type).toBe("oauth");
113-expect(profile?.email).toBe("user@example.com");
114-expect(profile?.expiresAt).toBe("2027-01-15T08:00:00.000Z");
115-expect(profile?.cooldownUntil).toBe("2027-01-15T08:00:10.000Z");
116117});
117118118119it("prints an empty profile list without failing", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。