Skip to content

Commit

Permalink
fix(cli): Handle browser initialization failure (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarescu authored Jan 28, 2025
1 parent ad72023 commit 750b613
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/shortest/src/core/runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,17 @@ export class TestRunner {
const compiledPath = await this.compiler.compileFile(file);
await import(pathToFileURL(compiledPath).href);

const context = await this.browserManager.launch();
let context;
try {
context = await this.browserManager.launch();
} catch (error) {
console.error(
`Browser initialization failed: ${
error instanceof Error ? error.message : String(error)
}`,
);
return;
}
const testContext = await this.createTestContext(context);

try {
Expand Down

0 comments on commit 750b613

Please sign in to comment.