stdout-stderr
v0.1.13
Published
mock stdout and stderr
Downloads
806,671
Readme
stdout-stderr
mock stdout and stderr
Usage:
const {stdout, stderr} = require('stdout-stderr')
stdout.start() // start mocking stdout
console.log('writing to stdout') // this will not be displayed
stdout.stop() // stop mocking stdout
assert(stdout.output === 'writing to stdout') // view the output
/* options */
stdout.stripColor = false // disable automatic ansi code stripping
stdout.print = true // also output to screen
This uses the debug module so you can also see the output by setting DEBUG=stdout|stderr|*
.