fix: sync tests with config normalization
This commit is contained in:
@@ -54,7 +54,7 @@ describe("getOpencodeZenStaticFallbackModels", () => {
|
|||||||
it("returns an array of models", () => {
|
it("returns an array of models", () => {
|
||||||
const models = getOpencodeZenStaticFallbackModels();
|
const models = getOpencodeZenStaticFallbackModels();
|
||||||
expect(Array.isArray(models)).toBe(true);
|
expect(Array.isArray(models)).toBe(true);
|
||||||
expect(models.length).toBe(10);
|
expect(models.length).toBe(9);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("includes Claude, GPT, Gemini, and GLM models", () => {
|
it("includes Claude, GPT, Gemini, and GLM models", () => {
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ describe("cron cli", () => {
|
|||||||
|
|
||||||
const updateCall = callGatewayFromCli.mock.calls.find((call) => call[0] === "cron.update");
|
const updateCall = callGatewayFromCli.mock.calls.find((call) => call[0] === "cron.update");
|
||||||
const patch = updateCall?.[2] as { patch?: { agentId?: unknown } };
|
const patch = updateCall?.[2] as { patch?: { agentId?: unknown } };
|
||||||
expect(patch?.patch?.agentId).toBe("ops");
|
expect(patch?.patch?.agentId).toBe("Ops");
|
||||||
|
|
||||||
callGatewayFromCli.mockClear();
|
callGatewayFromCli.mockClear();
|
||||||
await program.parseAsync(["cron", "edit", "job-2", "--clear-agent"], {
|
await program.parseAsync(["cron", "edit", "job-2", "--clear-agent"], {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ describe("normalizeCronJobCreate", () => {
|
|||||||
},
|
},
|
||||||
}) as unknown as Record<string, unknown>;
|
}) as unknown as Record<string, unknown>;
|
||||||
|
|
||||||
expect(normalized.agentId).toBe("ops");
|
expect(normalized.agentId).toBe("Ops");
|
||||||
|
|
||||||
const cleared = normalizeCronJobCreate({
|
const cleared = normalizeCronJobCreate({
|
||||||
name: "agent-clear",
|
name: "agent-clear",
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { inspect } from "node:util";
|
||||||
import { Client } from "@buape/carbon";
|
import { Client } from "@buape/carbon";
|
||||||
import { GatewayIntents, GatewayPlugin } from "@buape/carbon/gateway";
|
import { GatewayIntents, GatewayPlugin } from "@buape/carbon/gateway";
|
||||||
import { Routes } from "discord-api-types/v10";
|
import { Routes } from "discord-api-types/v10";
|
||||||
@@ -95,7 +96,7 @@ function formatDiscordDeployErrorDetails(err: unknown): string {
|
|||||||
try {
|
try {
|
||||||
bodyText = JSON.stringify(rawBody);
|
bodyText = JSON.stringify(rawBody);
|
||||||
} catch {
|
} catch {
|
||||||
bodyText = String(rawBody);
|
bodyText = inspect(rawBody, { depth: 3 });
|
||||||
}
|
}
|
||||||
if (bodyText) {
|
if (bodyText) {
|
||||||
const maxLen = 800;
|
const maxLen = 800;
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ describe("resolveAgentRoute", () => {
|
|||||||
accountId: undefined,
|
accountId: undefined,
|
||||||
peer: { kind: "dm", id: "+1000" },
|
peer: { kind: "dm", id: "+1000" },
|
||||||
});
|
});
|
||||||
expect(defaultRoute.agentId).toBe("defaultacct");
|
expect(defaultRoute.agentId).toBe("defaultAcct");
|
||||||
expect(defaultRoute.matchedBy).toBe("binding.account");
|
expect(defaultRoute.matchedBy).toBe("binding.account");
|
||||||
|
|
||||||
const otherRoute = resolveAgentRoute({
|
const otherRoute = resolveAgentRoute({
|
||||||
|
|||||||
Reference in New Issue
Block a user