Support for inspecting both stdout and stderr?
paambaati opened this issue · comments
GP commented
I'm not sure if this is technically feasible, but it would be great to inspect both stdout
and stderr
.
Use-case
Test a CLI program that writes to both stdout
and stderr
in a run.
James Shore commented
They are both supported:
var stdout = require("test-console").stdout;
var stderr = require("test-console").stderr;
var stdoutInspect = stdout.inspect();
var stderrInspect = stderr.inspect();
functionUnderTest();
stdoutInspect.restore();
stderrInspect.restore();
assert.deepEqual(stdoutInspect.output, [ "foo\n" ]);
assert.deepEqual(stderrInspect.output, [ "bar\n" ]);