Closed nopeless closed 3 years ago
tried to edit the code myself only to find myself struggling with this
context
@nopeless
I don't see why this functionality was not compatible with v3.0
Essentially that functionality became impossible when converting mocha-suppress-logs
to use Root Hook Plugins, which is the proper way it "you may want a hook before (or after) every test in every file". This change decoupled mocha-suppress-logs
from the Mocha BDD interface; Now it should work with any interface, even custom ones.
See the discussion starting at this comment.
If you can figure out a way to bring that back within a Root Hook Plugin, I'm sure it would be welcome.
I ended up creating a temporary wrapper that replaces console[level] variants to a log class (similar to what you did) your code gave me some inspiration
I think I should wait until mocha gives a mock function api like jest (might be wrong)
anyway it was because my specific library has a console.error instead of throw because it listens for file writes.
I don't want global suppression of console.logs
The feature that was in v2.0 was removed
I don't see why this functionality was not compatible with v3.0
Please consider bringing it back