mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
test(extensions): remove duplicate runtime replays (#122949)
This commit is contained in:
committed by
GitHub
parent
93d93d1d14
commit
08f9c3a5cb
@@ -45,30 +45,12 @@ const keepHttpServerTaskAliveMock = vi.hoisted(() =>
|
||||
}),
|
||||
);
|
||||
|
||||
vi.mock("../runtime-api.js", async () => {
|
||||
const { normalizeOptionalString } = await import("openclaw/plugin-sdk/string-coerce-runtime");
|
||||
vi.mock("../runtime-api.js", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("../runtime-api.js")>();
|
||||
return {
|
||||
DEFAULT_WEBHOOK_MAX_BODY_BYTES: 1024 * 1024,
|
||||
...actual,
|
||||
isDangerousNameMatchingEnabled,
|
||||
normalizeSecretInputString: normalizeOptionalString,
|
||||
hasConfiguredSecretInput: (value: unknown) =>
|
||||
typeof value === "string" && value.trim().length > 0,
|
||||
normalizeResolvedSecretInputString: (params: { value?: unknown }) =>
|
||||
typeof params?.value === "string" && params.value.trim() ? params.value.trim() : undefined,
|
||||
keepHttpServerTaskAlive: keepHttpServerTaskAliveMock,
|
||||
mergeAllowlist: (params: { existing?: string[]; additions: string[] }) =>
|
||||
Array.from(new Set([...(params.existing ?? []), ...params.additions])),
|
||||
resolveChannelMediaMaxBytes: (params: {
|
||||
cfg: OpenClawConfig;
|
||||
resolveChannelLimitMb: (context: { cfg: OpenClawConfig }) => number | undefined;
|
||||
}) => {
|
||||
const mediaMaxMb =
|
||||
params.resolveChannelLimitMb({ cfg: params.cfg }) ??
|
||||
params.cfg.agents?.defaults?.mediaMaxMb;
|
||||
return typeof mediaMaxMb === "number" && mediaMaxMb > 0
|
||||
? Math.floor(mediaMaxMb * 1024 * 1024)
|
||||
: undefined;
|
||||
},
|
||||
summarizeMapping: vi.fn(),
|
||||
};
|
||||
});
|
||||
|
||||
@@ -231,18 +231,6 @@ describe("slack socket reconnect helpers", () => {
|
||||
await expect(waiter).resolves.toEqual({ event: "disconnect" });
|
||||
});
|
||||
|
||||
it("leaves transient socket errors to the native reconnect lifecycle", async () => {
|
||||
const client = new FakeEmitter();
|
||||
const app = { receiver: { client } };
|
||||
const err = new Error("dns down");
|
||||
|
||||
const waiter = waitForSlackSocketDisconnect(app as never);
|
||||
client.emit("error", err);
|
||||
client.emit("disconnected");
|
||||
|
||||
await expect(waiter).resolves.toEqual({ event: "disconnect" });
|
||||
});
|
||||
|
||||
it("installs the disconnect waiter before socket start completes", async () => {
|
||||
const client = new FakeEmitter();
|
||||
const app = {
|
||||
|
||||
Reference in New Issue
Block a user