testing-library / pptr-testing-library

puppeteer + dom-testing-library = 💖
MIT License
287 stars 29 forks source link

support puppeteer-core with pptr-testing-library/extend #48

Open catdad opened 4 years ago

catdad commented 4 years ago

Current, the extend tries to require and modify the puppeteer module. However, I've found several use cases for using puppeteer-core to already-installed browsers and not require users to install an unnecessary version of chromium. One such example is when testing Electron apps.

It would be great if the extend helper could work with puppeteer-core as well. Currently, it hard-codes looking for puppeteer specifically. When it is not available, it errors. I did a quick check and it seems to work just fine with puppeteer-core. Perhaps it can be added as an extra libPrefix to check?

patrickhulce commented 4 years ago

Thanks for filing @catdad! Yeah this SGTM 👍