





























@@ -513,8 +513,9 @@ describe("dispatchTelegramMessage draft streaming", () => {
513513});
514514expect(draftStream.update).toHaveBeenCalledWith("Hello");
515515const delivery = expectDeliverRepliesParams({ thread: { id: 777, scope: "dm" } });
516-expect(delivery.mediaLocalRoots).toContainEqual(
517-expect.stringMatching(/[\\/]\.openclaw[\\/]workspace-work$/u),
516+const mediaLocalRoots = delivery.mediaLocalRoots as string[] | undefined;
517+expect(mediaLocalRoots?.some((root) => /[\\/]\.openclaw[\\/]workspace-work$/u.test(root))).toBe(
518+true,
518519);
519520const dispatchParams = expectDispatchParams({});
520521expect(
@@ -1065,7 +1066,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
10651066telegramCfg: { streaming: { mode: "partial" } },
10661067});
106710681068-expect(answerDraftStream.update).toHaveBeenNthCalledWith(1, expect.stringMatching(/Exec/));
1069+expect(answerDraftStream.update.mock.calls[0]?.[0]).toContain("Exec");
10691070expect(answerDraftStream.update).toHaveBeenNthCalledWith(2, "Done ");
10701071expect(answerDraftStream.update).toHaveBeenNthCalledWith(3, "Done answer");
10711072expect(answerDraftStream.update).toHaveBeenLastCalledWith("Done answer.");
@@ -1135,7 +1136,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
11351136});
1136113711371138expect(answerDraftStream.update).toHaveBeenCalledWith(
1138-expect.stringMatching(/`🛠️ git rev-parse --abbrev-ref HEAD`$/),
1139+"Cracking...\n`🛠️ Exec`\n`🛠️ git rev-parse --abbrev-ref HEAD`",
11391140);
11401141expect(answerDraftStream.update).not.toHaveBeenCalledWith("Branch is up to date");
11411142expect(answerDraftStream.clear).toHaveBeenCalledTimes(1);
@@ -1198,7 +1199,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
11981199telegramCfg: { streaming: { mode: "progress", progress: { label: "Shelling" } } },
11991200});
120012011201-expect(draftStream.update).toHaveBeenCalledWith(expect.stringMatching(/^Shelling\n`🛠️ Exec`$/));
1202+expect(draftStream.update).toHaveBeenCalledWith("Shelling\n`🛠️ Exec`");
12021203expect(draftStream.flush).toHaveBeenCalled();
12031204});
12041205@@ -1257,7 +1258,7 @@ describe("dispatchTelegramMessage draft streaming", () => {
12571258});
1258125912591260expect(draftStream.update).toHaveBeenCalledWith(
1260-expect.stringMatching(/^Shelling\n`🔎 Web Search: docs lookup`\n• `tests passed`$/),
1261+"Shelling\n`🔎 Web Search: docs lookup`\n• `tests passed`",
12611262);
12621263expect(draftStream.forceNewMessage).not.toHaveBeenCalled();
12631264expect(draftStream.materialize).not.toHaveBeenCalled();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。