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

Customize error message #11

Closed JCB-K closed 2 years ago

JCB-K commented 2 years ago

Hi!

Thanks for a great package :). Would you accept a PR that allows an optional config option for a custom error message? We want to adopt this package, but I'm afraid that the default message will nudge maintainers to just mock console.error as an easy way out, even when errors aren't expected. A custom error message would allow me to link to an internal documentation page with our common errors and how to handle them.

ValentinH commented 2 years ago

Thank you for the kind words! Yes I would accept such a PR 🙂

Moreover, if you have ideas to improve the default one in a way that would be more helpful for the community, you are welcome ! 🎉