Skip to content

Commit eec1662

Browse files
authored
Merge pull request #262 from objectstack-ai/copilot/fix-action-job-error
2 parents 2db1f41 + 7c214e7 commit eec1662

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.storybook/test-runner.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import type { TestRunnerConfig } from '@storybook/test-runner';
2+
3+
// Extend Window interface to include __test property
4+
// Note: This variable is referenced in test-runner's page.evaluate calls
5+
// but not directly in our codebase. It appears to be expected by the test environment.
6+
declare global {
7+
interface Window {
8+
__test?: boolean;
9+
}
10+
}
11+
12+
const config: TestRunnerConfig = {
13+
async preVisit(page) {
14+
// Inject __test global to prevent ReferenceError during test execution
15+
// This addresses the error: "page.evaluate: ReferenceError: __test is not defined"
16+
// that occurs when running Storybook test-runner smoke tests
17+
await page.evaluate(() => {
18+
window.__test = true;
19+
});
20+
},
21+
};
22+
23+
export default config;

0 commit comments

Comments
 (0)