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:
Dmitry Gozman 2020-05-13 17:19:07 -07:00 committed by GitHub
parent 03cae92ff2
commit 884860b803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,7 @@ describe('Playwright', function() {
});
it('should handle exception', async({browserType, defaultBrowserOptions}) => {
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);
expect(error).toBe(e);
});