Skip to content

Commit 496ab2a

Browse files
Copilothotlong
andcommitted
Simplify test-runner config to minimal working version
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 315945c commit 496ab2a

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

.storybook/test-runner.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
import type { TestRunnerConfig } from '@storybook/test-runner';
22

33
const 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

2412
export default config;

0 commit comments

Comments
 (0)