Skip to content

Commit 2622b47

Browse files
authored
Merge pull request #28 from freema/claude/fix-node-22-tests-01SBCp2mmYcoW95jd5w5ha9a
Fix Node 22 test coverage failure
2 parents 7589695 + 55d785a commit 2622b47

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/helpers/firefox.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ export async function createTestFirefox(options?: Partial<FirefoxLaunchOptions>)
2525

2626
/**
2727
* Cleanup helper to close Firefox instance
28+
* Handles the case where firefox is undefined (e.g., when beforeAll times out)
2829
*/
29-
export async function closeFirefox(firefox: FirefoxClient): Promise<void> {
30+
export async function closeFirefox(firefox: FirefoxClient | undefined | null): Promise<void> {
31+
if (!firefox) {
32+
// Firefox was never initialized (e.g., beforeAll timed out)
33+
return;
34+
}
3035
try {
3136
await firefox.close();
3237
} catch (error) {

0 commit comments

Comments
 (0)