Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New debug function spams console.logs when used with Jest #6147

Closed
wojtekmaj opened this issue Jul 3, 2020 · 0 comments · Fixed by #6148
Closed

New debug function spams console.logs when used with Jest #6147

wojtekmaj opened this issue Jul 3, 2020 · 0 comments · Fixed by #6148

Comments

@wojtekmaj
Copy link
Contributor

wojtekmaj commented Jul 3, 2020

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 5.0.0
  • Platform / OS version: macOS Catalina
  • URLs (if applicable): n/a
  • Node.js version: 12.16.2

What steps will reproduce the problem?

When running Puppeteer via Jest (which provides global.document from JSDOM), isNode variable which new debug function uses improperly returns false.

What is the expected result?

Puppeteer remains relatively silent, not spamming with debug messages unless told to.

What happens instead?

Jest causes Puppeteer to spam the console with countless console.logs.

In fact, there are so many now that I've reached the limit of log length and my builds started crashing. This did not occur in v4.x.

I guess the core issue is that

  • there is no way to stop the console.logs via any config, unlike in debug package where DEBUG env variable has to be provided for it to start logging debug stuff AND
  • console.logs are used in Node environment if document variable is available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant