WrapSilent Class
Prevents node-tap harness from writing output to STDOUT
- Creates a new stream that returns summary of results in JSON so can access programmatically
- Good for testing test helpers -> eg used in unit tests for tap-test-helpers module
so can do fn.Producer.on('end', fn (results))
Constructor
WrapSilent
(
Function
-
test -
tp
Parameters:
-
testFunctionhelper function which contains tap.test() function
-
tpAbstractFactoryinstance of tap.Producer stream
Returns:
Function:
returns original function bound to new context
Methods
end
(
-
t
Handle test end call
Parameters:
-
tTestinstance of Tap.test
silence
(
-
t
Silence the tap.test output to STDOUT by calling t.clear() Save results first and pipe into new tap.Producer stream
Parameters:
-
tTestinstance of Tap.test
writeStream
(
-
res
Pipe the results using the Tap.Producer stream
Parameters:
-
resObjectJSON obj representing test results
Properties
Factory
AbstractFactory
Factory instance of AbstractFactory class
Producer
Tap.Producer
Producer new instance of tap.Producer
test
Function
test helper function passed as param, now bound to WrapSilent context
