test: unflake launcher test (#2224)
We throw an exception and then gracefully close the browser. If something went wrong, we should timeout before the test times out, kill the process and report the original exception.
This commit is contained in:
parent
03cae92ff2
commit
884860b803
|
|
@ -58,7 +58,7 @@ describe('Playwright', function() {
|
||||||
});
|
});
|
||||||
it('should handle exception', async({browserType, defaultBrowserOptions}) => {
|
it('should handle exception', async({browserType, defaultBrowserOptions}) => {
|
||||||
const e = new Error('Dummy');
|
const e = new Error('Dummy');
|
||||||
const options = { ...defaultBrowserOptions, __testHookBeforeCreateBrowser: () => { throw e; } };
|
const options = { ...defaultBrowserOptions, __testHookBeforeCreateBrowser: () => { throw e; }, timeout: 9000 };
|
||||||
const error = await browserType.launch(options).catch(e => e);
|
const error = await browserType.launch(options).catch(e => e);
|
||||||
expect(error).toBe(e);
|
expect(error).toBe(e);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue