Create and destroy Kinesis and Kinesalite streams for use in tape tests
var tape = ;var kinesis = tape 'my-project' 1 'us-east-1';kinesis;kinesis;
var kinesis = require('kinesis-test')(tape, projectName, shards, [region])
Provide your own
tape object, then provide an arbitrary
projectName (used in your stream's name) and number of
shards. If you specify a
region, then real-life Kinesis used. If not, then it will work locally using kinesalite.
Provides the name of your test stream.
Provides an AWS.Kineis object configured to communicate with your stream (real-life or kinesalite).
Creates a kinesis stream for you to test against.
Once your stream is created,
shards will provide you an array of functions, one for each shard. Pass an
options object to this function in order to create a kinesis-readable streams.
Loads records into your stream.
fixtures must be an array of objects which each provde a
Deletes the stream.
kinesis.test(name, [fixtures], callback)
A wrapper around tape that:
- creates a fresh stream
- optionally, loads
fixturesthat you provide
- runs your tests by providing an
assertionobject to your
- deletes your stream
If you're working in a mock test environment, use this call to shut down kinesalite.