HomePhabricator

[node apps using mocha] suppress console.log output from passed unit tests

Description

[node apps using mocha] suppress console.log output from passed unit tests

Summary:
T2972

Implement mocha-suppress-logs to suppress console.log statements from passed unit tests (console.log will still print in failed unit tests, which is helpful for developing).

Unit test checking output of logs is removed from alias-server. This diff caused the tests to fail, as would any future diff changing those logs. Best practice not to test output of console.log statements.

While it does seem silly to use yet another module to accomplish this, it is quite small, well-tested, and seems to be the standard way. Plugins to augment performance of engines like mocha or eslint is standard js.

Test Plan: npm test in affected repos, no console.log statements

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13590

Details

Provenance
bytesofmanAuthored on Apr 5 2023, 22:25
bytesofmanPushed on Apr 6 2023, 12:32
Reviewer
Restricted Project
Differential Revision
D13590: [node apps using mocha] suppress console.log output from passed unit tests
Parents
rABC97b52f90be23: [lint] don't add newline to empty python files
Branches
Unknown
Tags
Unknown