xfumihiro/jest-puppeteer-example

What is the reason for all the wsEndpoint stuff?

alanshaw opened this issue · 3 comments

I can't see an explanation here or in this repo...

Why is it so complicated?

This ensures that only one instance of Chromium is running for all the test suites. The alternative is to launch a new Chromium instance for each test suite, which is slower and more expensive.

setup.js runs once globally to launch the Chromium and puppeteer_environment.js hooks each test suite up to that instance by using .connnet

https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerconnectoptions

I see, thank you!