We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 60c938e + 6988698 commit db72d19Copy full SHA for db72d19
.storybook/test-runner.cjs
@@ -0,0 +1,13 @@
1
+/**
2
+ * @type {import('@storybook/test-runner').TestRunnerConfig}
3
+ */
4
+module.exports = {
5
+ async preVisit(page) {
6
+ // Inject __test global to prevent ReferenceError during test execution
7
+ // This addresses the error: "page.evaluate: ReferenceError: __test is not defined"
8
+ // that occurs when running Storybook test-runner smoke tests
9
+ await page.evaluate(() => {
10
+ window.__test = true;
11
+ });
12
+ },
13
+};
.storybook/test-runner.ts
0 commit comments