fix: stabilize docs and tests after system event timestamps
This commit is contained in:
@@ -33,9 +33,7 @@ describe("prependSystemEvents", () => {
|
||||
second: "2-digit",
|
||||
});
|
||||
|
||||
expect(result).toContain(
|
||||
`System: [${expectedTimestamp}] Model switched.`,
|
||||
);
|
||||
expect(result).toContain(`System: [${expectedTimestamp}] Model switched.`);
|
||||
|
||||
resetSystemEventsForTest();
|
||||
vi.useRealTimers();
|
||||
|
||||
@@ -31,7 +31,7 @@ beforeEach(() => {
|
||||
describe("discord native commands", () => {
|
||||
it(
|
||||
"streams tool results for native slash commands",
|
||||
{ timeout: 10_000 },
|
||||
{ timeout: 30_000 },
|
||||
async () => {
|
||||
const { ChannelType } = await import("@buape/carbon");
|
||||
const { createDiscordNativeCommand } = await import("./monitor.js");
|
||||
|
||||
@@ -179,7 +179,9 @@ export function registerDiscordListener(
|
||||
listeners: Array<object>,
|
||||
listener: object,
|
||||
) {
|
||||
if (listeners.some((existing) => existing.constructor === listener.constructor)) {
|
||||
if (
|
||||
listeners.some((existing) => existing.constructor === listener.constructor)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
listeners.push(listener);
|
||||
|
||||
@@ -47,7 +47,9 @@ describe("system events (session routing)", () => {
|
||||
isNewSession: false,
|
||||
prefixedBodyBase: "hi",
|
||||
});
|
||||
expect(discord).toBe("System: Discord reaction added: ✅\n\nhi");
|
||||
expect(discord).toMatch(
|
||||
/^System: \[[^\]]+\] Discord reaction added: ✅\n\nhi$/,
|
||||
);
|
||||
expect(peekSystemEvents("discord:group:123")).toEqual([]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user