Skip to content

Commit 6fa3f5e

Browse files
Copilothotlong
andcommitted
Add test-runner configuration to define __test global variable
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 655c296 commit 6fa3f5e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.storybook/test-runner.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { TestRunnerConfig } from '@storybook/test-runner';
2+
3+
const config: TestRunnerConfig = {
4+
// Hook that is executed before the test runner starts running tests
5+
async preVisit(page) {
6+
// Set up any global variables or configurations needed for tests
7+
await page.evaluate(() => {
8+
// Define __test global if it's being referenced by test infrastructure
9+
(window as any).__test = true;
10+
});
11+
},
12+
};
13+
14+
export default config;

0 commit comments

Comments
 (0)