fixture-stdout
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -8,4 +8,11 @@ var StdOutFixture = require('./'); | ||
fixture.capture( /* optionally, provide a capture fn. See readme for args. */ ); | ||
fixture.capture( | ||
// Optionally, provide a capture fn here. | ||
// See readme for args. | ||
// e.g. function (string, encoding, fd) { return; } | ||
// Return `false` to prevent the write. | ||
// e.g. function (){ return false; } | ||
); | ||
// Uses intercepted version of stdout | ||
@@ -12,0 +19,0 @@ console.log('a'); |
@@ -32,6 +32,5 @@ /** | ||
return function (string, encoding, fd) { | ||
var interceptorReturnedTruthy = callback(string, encoding, fd); | ||
if (interceptorReturnedTruthy) { | ||
write.apply(stream, arguments); | ||
} | ||
var interceptorReturnedFalse = false === callback(string, encoding, fd); | ||
if (interceptorReturnedFalse) return; | ||
else write.apply(stream, arguments); | ||
}; | ||
@@ -38,0 +37,0 @@ })(stream.write); |
{ | ||
"name": "fixture-stdout", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "A test fixture to intercept writes to stdout.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5115
72