import type { TestRunnerConfig } from "@storybook/test-runner"; const config: TestRunnerConfig = { async preVisit(page) { page.on("console", (msg) => { if (msg.type() === "error") { throw new Error(`Console error in story: ${msg.text()}`); } }); }, }; export default config;