0.1.1 • Published 8 years ago
xstdout v0.1.1
xstdout
capture stdout
Usage
Example:
const xstdout = require("xstdout");
const intercept = xstdout.intercept(true);
console.log("hello, world");
intercept.restore();
expect(intercept.stdout[0]).to.equal("hello, world\n");APIs
xstdout.intercept(silent, [silentErr])
Returns an object:
{
restore,
stdout,
stderr
}stdout/stderrare arrays of strings that captured stdout/stderrrestoreis a function that restores the original stdout/stderr
Params
silent- iftrue, then omit actual output to console and only capturesilentErr- if notundefined, then independently controls output of stderr to console