From 2c911eb1f85ee64c1ea2d83109135fd58d640788 Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Tue, 23 Jan 2024 18:33:03 +0100 Subject: [PATCH] support unhandled errors --- src/setup-page-script.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/setup-page-script.ts b/src/setup-page-script.ts index 56b9c392..549e2ed7 100644 --- a/src/setup-page-script.ts +++ b/src/setup-page-script.ts @@ -380,6 +380,11 @@ async function __test(storyId: string): Promise { reject(new StorybookTestRunnerError(storyId, error.message, logs)); }, + unhandledErrorsWhilePlaying: (error: Error) => { + cleanup(listeners); + reject(new StorybookTestRunnerError(storyId, error.message, logs)); + }, + storyMissing: (id: string) => { cleanup(listeners); if (id === storyId) {