fix(ci): default local low-memory checks

This commit is contained in:
Vincent Koc
2026-03-31 15:03:08 +09:00
parent 3a87783632
commit 8dfbcaa200
13 changed files with 198 additions and 90 deletions

View File

@@ -6,8 +6,14 @@ import {
createTestDraftStream,
} from "./draft-stream.test-helpers.js";
type DispatchReplyWithBufferedBlockDispatcherArgs = Parameters<
TelegramBotDeps["dispatchReplyWithBufferedBlockDispatcher"]
>[0];
const createTelegramDraftStream = vi.hoisted(() => vi.fn());
const dispatchReplyWithBufferedBlockDispatcher = vi.hoisted(() => vi.fn());
const dispatchReplyWithBufferedBlockDispatcher = vi.hoisted(() =>
vi.fn<(params: DispatchReplyWithBufferedBlockDispatcherArgs) => Promise<unknown>>(),
);
const deliverReplies = vi.hoisted(() => vi.fn());
const emitInternalMessageSentHook = vi.hoisted(() => vi.fn());
const createForumTopicTelegram = vi.hoisted(() => vi.fn());
@@ -2113,7 +2119,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
const draftStream = createDraftStream(999);
createTelegramDraftStream.mockReturnValue(draftStream);
dispatchReplyWithBufferedBlockDispatcher.mockImplementation(async ({ dispatcherOptions }) => {
dispatcherOptions.onSkip?.({ text: "" }, { reason: "no_reply", kind: "final" });
dispatcherOptions.onSkip?.({ text: "" }, { reason: "empty", kind: "final" });
return { queuedFinal: false };
});
deliverReplies.mockResolvedValueOnce({ delivered: true });
@@ -2139,7 +2145,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
try {
await dispatcherOptions.deliver({ text: "Hello" }, { kind: "final" });
} catch (err) {
dispatcherOptions.onError(err, { kind: "final" });
dispatcherOptions.onError?.(err, { kind: "final" });
}
return { queuedFinal: false };
});
@@ -2167,7 +2173,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
try {
await dispatcherOptions.deliver({ text: "Hello" }, { kind: "final" });
} catch (err) {
dispatcherOptions.onError(err, { kind: "final" });
dispatcherOptions.onError?.(err, { kind: "final" });
}
return { queuedFinal: false };
});
@@ -2231,7 +2237,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
try {
await dispatcherOptions.deliver({ text: "Hello" }, { kind: "final" });
} catch (err) {
dispatcherOptions.onError(err, { kind: "final" });
dispatcherOptions.onError?.(err, { kind: "final" });
}
return { queuedFinal: false };
});