ValentinH / jest-fail-on-console

Utility to make jest tests fail when console.error() or any other methods are used
MIT License
141 stars 20 forks source link

Add `mockImplementation` info to warning message. #9

Closed SDRACK closed 2 years ago

SDRACK commented 2 years ago

I wonder if it's worth adding the info about mockImplementation from the readme (here) to the warning message this package throws?

I'm pretty new to Jest, and didn't pick that up from the existing error message:

If the error is expected, test for it explicitly by mocking it out using jest.spyOn(console, 'error') and test that the warning occurs.

(An aside, love the package - it's been really helpful for us.)

ValentinH commented 2 years ago

Yes I think this could be nice. Would you like to create a PR for this?