File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { TestRunnerConfig } from '@storybook/test-runner' ;
22
33const config : TestRunnerConfig = {
4- // Hook that is executed once before all tests
5- async setup ( ) {
6- // Global setup if needed
7- } ,
8-
9- // Hook that is executed before the test runner starts running tests
104 async preVisit ( page ) {
11- // Set up any global variables or configurations needed for tests
5+ // Inject __test global to prevent ReferenceError during test execution
126 await page . evaluate ( ( ) => {
13- // Define __test global if it's being referenced by test infrastructure
147 ( window as any ) . __test = true ;
158 } ) ;
169 } ,
17-
18- // Hook that is executed after the test runner finishes running tests
19- async postVisit ( page ) {
20- // Clean up if needed
21- } ,
2210} ;
2311
2412export default config ;
You can’t perform that action at this time.
0 commit comments