Repository: puppeteer/puppeteer
File: test/src/launcher.spec.ts (TypeScript)

Code before:
          defaultViewport: null,
          debuggingPort: 9999,
        });
        try {
          const url = new URL(browser.wsEndpoint());
          expect(url.port).toBe('9999');
        } finally {
          await close();
        }
      });
      it('should not allow setting debuggingPort and pipe', async () => {
        const {defaultBrowserOptions} = await getTestState();

        const options = Object.assign({}, defaultBrowserOptions, {
          defaultViewport: null,
          debuggingPort: 9999,
          pipe: true,
        });

        let error!: Error;
        await launch(options).catch(error_ => {
          return (error = error_);
        });
        expect(error.message).toContain('either pipe or debugging port');
      });
      it.skip('should launch Chrome properly with --no-startup-window and waitForInitialPage=false', async () => {
        const {defaultBrowserOptions} = await getTestState({
          skipLaunch: true,
        });
        const options = {
          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,
          args: ['--no-startup-window'],
        };
        const {browser, close} = await launch(options, {
          createContext: false,
        });
        try {
          const pages = await browser.pages();
          expect(pages).toHaveLength(0);
        } finally {
          await close();
        }
      });
    });

    describe('Puppeteer.launch', function () {
      itOnlyRegularInstall('should be able to launch Chrome', async () => {

Review comment (suggestion):
```suggestion
      it('should launch Chrome properly with --no-startup-window and waitForInitialPage=false', async () => {
```

Code after:
          defaultViewport: null,
          debuggingPort: 9999,
        });
        try {
          const url = new URL(browser.wsEndpoint());
          expect(url.port).toBe('9999');
        } finally {
          await close();
        }
      });
      it('should not allow setting debuggingPort and pipe', async () => {
        const {defaultBrowserOptions} = await getTestState();

        const options = Object.assign({}, defaultBrowserOptions, {
          defaultViewport: null,
          debuggingPort: 9999,
          pipe: true,
        });

        let error!: Error;
        await launch(options).catch(error_ => {
          return (error = error_);
        });
        expect(error.message).toContain('either pipe or debugging port');
      });
      it('should launch Chrome properly with --no-startup-window and waitForInitialPage=false', async () => {
        const {defaultBrowserOptions} = await getTestState({
          skipLaunch: true,
        });
        const options = {
          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,
          args: ['--no-startup-window'],
        };
        const {browser, close} = await launch(options, {
          createContext: false,
        });
        try {
          const pages = await browser.pages();
          expect(pages).toHaveLength(0);
        } finally {
          await close();
        }
      });
    });

    describe('Puppeteer.launch', function () {
      itOnlyRegularInstall('should be able to launch Chrome', async () => {