






















@@ -727,14 +727,15 @@ function requireBlockReplyHandler(
727727}
728728729729async function dispatchTwiceWithFreshDispatchers(params: Omit<DispatchReplyArgs, "dispatcher">) {
730-await dispatchReplyFromConfig({
730+const first = await dispatchReplyFromConfig({
731731 ...params,
732732dispatcher: createDispatcher(),
733733});
734-await dispatchReplyFromConfig({
734+const second = await dispatchReplyFromConfig({
735735 ...params,
736736dispatcher: createDispatcher(),
737737});
738+return [first, second] as const;
738739}
739740740741describe("dispatchReplyFromConfig", () => {
@@ -2740,16 +2741,9 @@ describe("dispatchReplyFromConfig", () => {
27402741});
27412742const replyResolver = vi.fn(async () => ({ text: "hi" }) as ReplyPayload);
274227432743-const first = await dispatchReplyFromConfig({
2744+const [first, duplicate] = await dispatchTwiceWithFreshDispatchers({
27442745 ctx,
27452746 cfg,
2746-dispatcher: createDispatcher(),
2747- replyResolver,
2748-});
2749-const duplicate = await dispatchReplyFromConfig({
2750- ctx,
2751- cfg,
2752-dispatcher: createDispatcher(),
27532747 replyResolver,
27542748});
27552749@@ -2771,16 +2765,9 @@ describe("dispatchReplyFromConfig", () => {
27712765});
27722766const replyResolver = vi.fn(async () => ({ text: "visible fallback" }) as ReplyPayload);
277327672774-const first = await dispatchReplyFromConfig({
2768+const [first, duplicate] = await dispatchTwiceWithFreshDispatchers({
27752769 ctx,
27762770 cfg,
2777-dispatcher: createDispatcher(),
2778- replyResolver,
2779-});
2780-const duplicate = await dispatchReplyFromConfig({
2781- ctx,
2782- cfg,
2783-dispatcher: createDispatcher(),
27842771 replyResolver,
27852772});
27862773此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。