




















@@ -1190,9 +1190,11 @@ describe("dispatchTelegramMessage draft streaming", () => {
11901190);
11911191expect(answerDraftStream.update).toHaveBeenNthCalledWith(2, "Branch is up to date");
11921192expect(answerDraftStream.forceNewMessage).toHaveBeenCalledTimes(1);
1193-expect(answerDraftStream.clear).not.toHaveBeenCalled();
1193+expect(answerDraftStream.clear).toHaveBeenCalledTimes(1);
1194+const clearOrder = answerDraftStream.clear.mock.invocationCallOrder[0];
11941195const rotationOrder = answerDraftStream.forceNewMessage.mock.invocationCallOrder[0];
11951196const finalUpdateOrder = answerDraftStream.update.mock.invocationCallOrder[1];
1197+expect(clearOrder).toBeLessThan(rotationOrder);
11961198expect(rotationOrder).toBeLessThan(finalUpdateOrder);
11971199});
11981200@@ -1209,9 +1211,11 @@ describe("dispatchTelegramMessage draft streaming", () => {
12091211expect(answerDraftStream.update).toHaveBeenNthCalledWith(1, "🛠️ Exec: pnpm test");
12101212expect(answerDraftStream.update).toHaveBeenNthCalledWith(2, "Tests passed");
12111213expect(answerDraftStream.forceNewMessage).toHaveBeenCalledTimes(1);
1212-expect(answerDraftStream.clear).not.toHaveBeenCalled();
1214+expect(answerDraftStream.clear).toHaveBeenCalledTimes(1);
1215+const clearOrder = answerDraftStream.clear.mock.invocationCallOrder[0];
12131216const rotationOrder = answerDraftStream.forceNewMessage.mock.invocationCallOrder[0];
12141217const finalUpdateOrder = answerDraftStream.update.mock.invocationCallOrder[1];
1218+expect(clearOrder).toBeLessThan(rotationOrder);
12151219expect(rotationOrder).toBeLessThan(finalUpdateOrder);
12161220});
12171221@@ -1241,7 +1245,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
12411245);
12421246expect(answerDraftStream.update).not.toHaveBeenCalledWith("Branch is up to date");
12431247expect(answerDraftStream.forceNewMessage).toHaveBeenCalledTimes(1);
1244-expect(answerDraftStream.clear).not.toHaveBeenCalled();
1248+expect(answerDraftStream.clear).toHaveBeenCalledTimes(1);
12451249expectDeliveredReply(0, { text: "Branch is up to date" });
12461250expect(editMessageTelegram).not.toHaveBeenCalled();
12471251});
@@ -1364,7 +1368,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
13641368);
13651369expect(draftStream.forceNewMessage).toHaveBeenCalledTimes(1);
13661370expect(draftStream.materialize).not.toHaveBeenCalled();
1367-expect(draftStream.clear).not.toHaveBeenCalled();
1371+expect(draftStream.clear).toHaveBeenCalledTimes(1);
13681372expectDeliveredReply(0, { text: "Final after tool" });
13691373expect(editMessageTelegram).not.toHaveBeenCalled();
13701374});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。