tape-drain
Plugin for tape that adds wrappers for assertion methods that automatically consume streams in the argument position.
Write
tdrain;
instead of
stream;
Less boilerplate, cleaner tests!
Example
var tape = ;var test = tape; ;
API
tape = tapeDrain(tape)
Adds tape.Test.prototype.drain
and returns modified tape
instance.
t.drain['method']
'method'
— any method of atape.Test
instance (most of the tape's API, includingequal
,deepEqual
,looseEqual
and other methods and aliases).
Consumes any streams passed in the arguments and calls the original method
with stream arguments replaced with their actual content.
Note that the drain wrapper is asynchronous, and so you should use t.plan
rather than t.end
when using it.
t.drain([opts])['method']
Options:
opts.buffer
Type: Boolean
Default: false
Replace streams with buffers rather than with strings.
Install
npm install tape-drain
License
MIT