Closed vassudanagunta closed 8 months ago
@AleG94, between the time I reported issue #8 and this issue, usage has doubled!. But it appears that you are busy with other priorities (I hope you are well).
Would you be willing to either give me write access or to transfer the repo to me? The latter could be temporary and I could transfer it back when your have more time.
This was long overdue and I'm sorry for that but it should now be fixed in version 0.4!
Fix confirmed. Thank you!
If multiple log levels (e.g.
console.log
andconsole.debug
) are used, and a test fails, mocha-suppress-logs prints the messages for each level separately, and thus out of order.For example, if the code writes messages in this order:
on test failure the output is:
Looking at the implementation, this is the result of capturing log messages for each level separately:
https://github.com/AleG94/mocha-suppress-logs/blob/ec776ce9da881e8c1a1008f5c96cc1222deec961/lib/log-capture.js#L30-L32
which means that on failure each level is written out separately and thus out of order: https://github.com/AleG94/mocha-suppress-logs/blob/ec776ce9da881e8c1a1008f5c96cc1222deec961/index.js#L15-L17
It make sense to fix this bug together with #8. The same code is responsible for both issues.