Skip to content

Commit 6988698

Browse files
Copilothotlong
andcommitted
Convert test-runner.ts to test-runner.cjs to fix ES module error
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 0cad802 commit 6988698

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

.storybook/test-runner.cjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)