test: await browser closing in tests (#2022)

This commit is contained in:
Andrey Lushnikov 2018-02-13 14:39:13 -08:00 committed by GitHub
parent ae22ef30b3
commit ee5ec3e630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -160,7 +160,7 @@ describe('Puppeteer', function() {
const page = await browser.newPage();
let error = null;
const neverResolves = page.evaluate(() => new Promise(r => {})).catch(e => error = e);
browser.close();
await browser.close();
await neverResolves;
expect(error.message).toContain('Protocol error');
});