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

Include group context on failure output #38

Closed lennym closed 1 year ago

lennym commented 1 year ago

If there is a call to console.group around a log|warn|error then it is being swallowed and so when tests fail the output of console.group is not emitted to the console.

Include any group context in the flushUnexpectedConsoleCalls output so it can be debugged.

lennym commented 1 year ago

I made a slight mistake on my earlier PR in that it completely silenced any output from console.group in the failure logs. It made our tests impossible to debug. Apologies for that.

ValentinH commented 1 year ago

Thanks for the hotfix. I'll release it in around a hour.

ValentinH commented 1 year ago

Released as https://github.com/ValentinH/jest-fail-on-console/releases/tag/v3.1.1

lennym commented 1 year ago

Fantastic. Thank you very much.