-
Notifications
You must be signed in to change notification settings - Fork 336
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
Prevent Chrome headless deprecation warning #3542
Conversation
jest-puppeteer.config.js
Outdated
* {@link https://developer.chrome.com/articles/new-headless/} | ||
*/ | ||
headless: process.env.HEADLESS !== 'false' | ||
? undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By defaulting to { headless: undefined }
we skip the deprecation checks in:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domoscargin Sadly they're using const headless = options.headless ?? true;
which compiles to:
const headless = (_a = options.headless) !== null && _a !== void 0 ? _a : true;
But we can default to 1
instead of undefined
to make this work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me!
I've raised this with the Puppeteer team as the intention probably wasn't to throw up 11x warnings per test run: |
391917f
to
08fce87
Compare
Prevents the warning by defaulting to `1` (not `true`) until we investigate “new” headless mode in: #3541
08fce87
to
9a16037
Compare
This PR prevents the recent Puppeteer
{ headless: true }
deprecation warning:headless: true
puppeteer/puppeteer#10039We can revisit this in future with “new” headless mode via:
Until then it prevents all the console spam we're getting: