Skip to content

Commit

Permalink
test: fail faster if browser crashes (#12310)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed Apr 23, 2024
1 parent a94fee9 commit be259de
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/src/mocha-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export const setupTestBrowserHooks = (): void => {
state.browser = await puppeteer.launch({
...processVariables.defaultBrowserOptions,
timeout: this.timeout() - 1_000,
protocolTimeout: this.timeout() * 2,
});
}
} catch (error) {
Expand Down Expand Up @@ -207,6 +208,8 @@ export const getTestState = async (

if (!state.browser) {
throw new Error('Browser was not set-up in time!');
} else if (!state.browser.connected) {
throw new Error('Browser has disconnected!');
}

if (state.context) {
Expand Down

0 comments on commit be259de

Please sign in to comment.