We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7589695 + 55d785a commit 2622b47Copy full SHA for 2622b47
tests/helpers/firefox.ts
@@ -25,8 +25,13 @@ export async function createTestFirefox(options?: Partial<FirefoxLaunchOptions>)
25
26
/**
27
* Cleanup helper to close Firefox instance
28
+ * Handles the case where firefox is undefined (e.g., when beforeAll times out)
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
+ }
35
try {
36
await firefox.close();
37
} catch (error) {
0 commit comments