Skip to content

Commit

Permalink
test(launcher): formatting the newly added waitForInitialPage test case
Browse files Browse the repository at this point in the history
To resolve the linter errors.
  • Loading branch information
starrify committed Apr 29, 2021
1 parent 75e5377 commit 11b6d12
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions test/launcher.spec.ts
Expand Up @@ -430,21 +430,24 @@ describe('Launcher specs', function () {
expect(screenshot).toBeInstanceOf(Buffer);
await browser.close();
});
itChromeOnly('should launch Chrome properly with --no-startup-window and waitForInitialPage=false', async function () {
const { defaultBrowserOptions, puppeteer } = getTestState();
const options = {
args: ['--no-startup-window'],
waitForInitialPage: false,
// This is needed to prevent Puppeteer from adding an initial blank page.
// See also https://github.com/puppeteer/puppeteer/blob/ad6b736039436fcc5c0a262e5b575aa041427be3/src/node/Launcher.ts#L200
ignoreDefaultArgs: true,
...defaultBrowserOptions,
itChromeOnly(
'should launch Chrome properly with --no-startup-window and waitForInitialPage=false',
async () => {
const { defaultBrowserOptions, puppeteer } = getTestState();
const options = {
args: ['--no-startup-window'],
waitForInitialPage: false,
// This is needed to prevent Puppeteer from adding an initial blank page.
// See also https://github.com/puppeteer/puppeteer/blob/ad6b736039436fcc5c0a262e5b575aa041427be3/src/node/Launcher.ts#L200
ignoreDefaultArgs: true,
...defaultBrowserOptions,
};
const browser = await puppeteer.launch(options);
const pages = await browser.pages();
expect(pages.length).toBe(0);
await browser.close();
}
const browser = await puppeteer.launch(options);
const pages = await browser.pages();
expect(pages.length).toBe(0);
await browser.close();
});
);
});

describe('Puppeteer.launch', function () {
Expand Down

0 comments on commit 11b6d12

Please sign in to comment.