Skip to content

Commit

Permalink
test: fix tests to work on node6 (#4851)
Browse files Browse the repository at this point in the history
Our magical node6 transpiler can't handle object spreads :(

Drive-by: use "includes" instead of "startsWith" for devtools URL
since I remember that it used to be "chrome-devtools://", and somehow
I saw it as "devtools://" somewhere.
  • Loading branch information
aslushnikov committed Aug 15, 2019
1 parent f47ed16 commit f595bc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/headful.spec.js
Expand Up @@ -118,11 +118,11 @@ module.exports.addTests = function({testRunner, expect, puppeteer, defaultBrowse
await browser.close();
});
it('should open devtools when "devtools: true" option is given', async({server}) => {
const browser = await puppeteer.launch({...headfulOptions, devtools: true});
const browser = await puppeteer.launch(Object.assign({devtools: true}, headfulOptions));
const context = await browser.createIncognitoBrowserContext();
await Promise.all([
context.newPage(),
context.waitForTarget(target => target.url().startsWith('devtools://')),
context.waitForTarget(target => target.url().includes('devtools://')),
]);
await browser.close();
});
Expand Down

0 comments on commit f595bc0

Please sign in to comment.