Closed lennym closed 1 year ago
I didn't know this group feature. I'd be happy to review a PR. 😊
Thanks. We'll likely put together a PR in the next few days.
Are you broadly happy with the approach to add additional context as a third parameter to silenceMessage
?
Yes I'm ok with this. I hesitated to do a breaking change and switch to a single object argument but I'm not sure it's worth the hassle.
Agreed. Probably worth doing if you ever go to v4 anyway, but this feels like a pretty niche feature, so not worth a v4 on its own.
Fixed by #37 and published as https://github.com/ValentinH/jest-fail-on-console/releases/tag/v3.1.0
Where console calls are wrapped in a
console.groupCollapsed
it would be good to have the group heading included in the message passed tosilenceMessage
.In our case we use
recoil
whichconsole.warn
s arbitrary objects collapsed with a predictable header. We'd like to be able to use this header to ignore the warnings rather than having to remove fail-on-warn completely.I'd imagine passing any group context as an additional argument to
silenceMessage
would be reasonably straightforward. Happy to put together a PR if required.