Can Winston logging be selectively disabled when executing unit tests of a node module?
Ideally, I\'d like to have logging for informational and debug purposes when the
If you are using Jest, you can disable it like so:
Set set up files to be run before jest runs the test. In package.json:
package.json
{ "jest": { "setupFiles": ["/jest-set-up/index.js"] } }
In jest-set-up/index.js:
jest-set-up/index.js
import winston from 'winston' winston.remove(winston.transports.Console)