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

console.assert from Puppeteer showing up in terminal after upgrading to v22.3.0 #5574

Closed
cdeutsch opened this issue Feb 15, 2018 · 10 comments
Closed

Comments

@cdeutsch
Copy link

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

console.assert from puppeteer is showing up in terminal when running tests.

image

What is the expected behavior?

The console.assert calls didn't show up in v22.1.4

@cdeutsch
Copy link
Author

Would the recent changes to Console.js or buffered_console.js cause this?
v22.1.4...v22.3.0

@SimenB
Copy link
Member

SimenB commented Feb 15, 2018

Yeah, this is #5514. The one from Page.js:648 looks legit, but we should not print the stackframe if there's nothing to log in an assert.

@ranyitz mind taking a look?

@ranyitz
Copy link
Contributor

ranyitz commented Feb 15, 2018

@SimenB I agree, I will fix it later on today.

@emilianionascu
Copy link

Thank you for the fix. Is there a new release coming for it or perhaps a way to disable the assertions until the official fix?

@SimenB
Copy link
Member

SimenB commented Feb 19, 2018

you should be able to do console.assert = jest.fn() in a setupfile

@emilianionascu
Copy link

@SimenB could you be more specific? I'm rather new to Jest, trying to use it with Puppeteer in a regression testing suite. I've created a jest.config.js file and tried to set it there assuming that console.assert were global. That didn't work.

@clement-bramy
Copy link

clement-bramy commented Feb 20, 2018

@emilianionascu

yourproject/tests/something.test.js

console.assert = jest.fn();
describe('your Jest test suite start here', () => {
  test('your unit test (or whatever you are doing)', () => {
    // do something
  });
});

works for me.

@SimenB
Copy link
Member

SimenB commented Feb 20, 2018

22.4.0 is released, btw, so this shouldn't be needed anymore

@SimenB
Copy link
Member

SimenB commented Feb 21, 2018

Oh, this wasn't closed.

#5576

@SimenB SimenB closed this as completed Feb 21, 2018
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants