test(ci): align main test expectations · openclaw/openclaw@0b82a7e
vincentkoc
·
2026-04-28
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -113,7 +113,33 @@ describe("buildStatusReply", () => {
|
113 | 113 | expect(reply?.text).not.toContain("Fallbacks: anthropic/claude-sonnet-4-6"); |
114 | 114 | }); |
115 | 115 | |
116 | | -it("keeps default fallback config when the agent has no explicit fallback override", async () => { |
| 116 | +it("keeps default fallback config when the agent has no explicit model", async () => { |
| 117 | +const cfg = { |
| 118 | +session: { mainKey: "main", scope: "per-sender" }, |
| 119 | +agents: { |
| 120 | +defaults: { |
| 121 | +model: { |
| 122 | +primary: "openai/gpt-5.4", |
| 123 | +fallbacks: ["anthropic/claude-sonnet-4-6"], |
| 124 | +}, |
| 125 | +}, |
| 126 | +list: [ |
| 127 | +{ |
| 128 | +id: "kira", |
| 129 | +}, |
| 130 | +], |
| 131 | +}, |
| 132 | +channels: { |
| 133 | +whatsapp: { allowFrom: ["*"] }, |
| 134 | +}, |
| 135 | +} as OpenClawConfig; |
| 136 | + |
| 137 | +const reply = await buildKiraStatusReply(cfg); |
| 138 | + |
| 139 | +expect(reply?.text).toContain("Fallbacks: anthropic/claude-sonnet-4-6"); |
| 140 | +}); |
| 141 | + |
| 142 | +it("keeps agent primary strict when the agent has no explicit fallback override", async () => { |
117 | 143 | const cfg = { |
118 | 144 | session: { mainKey: "main", scope: "per-sender" }, |
119 | 145 | agents: { |
@@ -139,7 +165,7 @@ describe("buildStatusReply", () => {
|
139 | 165 | |
140 | 166 | const reply = await buildKiraStatusReply(cfg); |
141 | 167 | |
142 | | -expect(reply?.text).toContain("Fallbacks: anthropic/claude-sonnet-4-6"); |
| 168 | +expect(reply?.text).not.toContain("Fallbacks:"); |
143 | 169 | }); |
144 | 170 | |
145 | 171 | it("treats an explicit empty per-agent fallback override as disabling inherited fallbacks", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { beforeEach, describe, expect, it, vi } from "vitest"; |
2 | 2 | import type { ChannelPlugin } from "../channels/plugins/types.plugin.js"; |
| 3 | +import { stripAnsi } from "../terminal/ansi.js"; |
3 | 4 | import { baseConfigSnapshot, createTestRuntime } from "./test-runtime-config-helpers.js"; |
4 | 5 | |
5 | 6 | const mocks = vi.hoisted(() => ({ |
@@ -176,7 +177,7 @@ describe("channels list auth profiles", () => {
|
176 | 177 | expect.any(Object), |
177 | 178 | expect.objectContaining({ includeSetupRuntimeFallback: true }), |
178 | 179 | ); |
179 | | -const output = runtime.log.mock.calls[0]?.[0] as string; |
| 180 | +const output = stripAnsi(runtime.log.mock.calls[0]?.[0] as string); |
180 | 181 | expect(output).toContain("Chat channels:"); |
181 | 182 | expect(output).toContain("Telegram default:"); |
182 | 183 | expect(output).toContain("configured"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。