






















@@ -20,6 +20,7 @@ describe("runGatewayHttpRequestStages", () => {
2020});
21212222it("skips a throwing stage marked continueOnError and continues to subsequent stages", async () => {
23+const stageError = new Error("Cannot find module '@slack/bolt'");
2324const stageC = vi.fn(() => true);
2425const consoleSpy = vi.spyOn(console, "error").mockImplementation(() => {});
2526@@ -29,7 +30,7 @@ describe("runGatewayHttpRequestStages", () => {
2930name: "broken-facade",
3031continueOnError: true,
3132run: () => {
32-throw new Error("Cannot find module '@slack/bolt'");
33+throw stageError;
3334},
3435},
3536{ name: "c", run: stageC },
@@ -41,13 +42,14 @@ describe("runGatewayHttpRequestStages", () => {
4142expect(stageC).toHaveBeenCalled();
4243expect(consoleSpy).toHaveBeenCalledWith(
4344expect.stringContaining('stage "broken-facade" threw'),
44-expect.any(Error),
45+stageError,
4546);
46474748consoleSpy.mockRestore();
4849});
49505051it("skips a rejecting async stage marked continueOnError and continues", async () => {
52+const stageError = new Error("ERR_MODULE_NOT_FOUND");
5153const stageC = vi.fn(() => true);
5254const consoleSpy = vi.spyOn(console, "error").mockImplementation(() => {});
5355@@ -56,7 +58,7 @@ describe("runGatewayHttpRequestStages", () => {
5658name: "async-broken",
5759continueOnError: true,
5860run: async () => {
59-throw new Error("ERR_MODULE_NOT_FOUND");
61+throw stageError;
6062},
6163},
6264{ name: "c", run: stageC },
@@ -68,7 +70,7 @@ describe("runGatewayHttpRequestStages", () => {
6870expect(stageC).toHaveBeenCalled();
6971expect(consoleSpy).toHaveBeenCalledWith(
7072expect.stringContaining('stage "async-broken" threw'),
71-expect.any(Error),
73+stageError,
7274);
73757476consoleSpy.mockRestore();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。