Skip to content

Commit f595bc0

Browse files
authored
test: fix tests to work on node6 (#4851)
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.
1 parent f47ed16 commit f595bc0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/headful.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ module.exports.addTests = function({testRunner, expect, puppeteer, defaultBrowse
118118
await browser.close();
119119
});
120120
it('should open devtools when "devtools: true" option is given', async({server}) => {
121-
const browser = await puppeteer.launch({...headfulOptions, devtools: true});
121+
const browser = await puppeteer.launch(Object.assign({devtools: true}, headfulOptions));
122122
const context = await browser.createIncognitoBrowserContext();
123123
await Promise.all([
124124
context.newPage(),
125-
context.waitForTarget(target => target.url().startsWith('devtools://')),
125+
context.waitForTarget(target => target.url().includes('devtools://')),
126126
]);
127127
await browser.close();
128128
});

0 commit comments

Comments
 (0)