Skip to content

Commit

Permalink
get back some test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
crccheck committed Jan 25, 2017
1 parent 69aa9bc commit 7c5de4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports._getShardIterator = getShardIterator
module.exports._readShard = readShard

module.exports.main = function (streamName, getShardIteratorOptions) {
getShardId(streamName)
return getShardId(streamName)
.then((shardIds) => {
const shardIterators = shardIds.map((shardId) =>
getShardIterator(streamName, shardId, getShardIteratorOptions))
Expand Down
11 changes: 11 additions & 0 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,15 @@ describe('main', () => {
clock.restore()
})
})

describe('main', () => {
it('logs when there is an error', () => {
AWS.Kinesis.prototype.describeStream = AWSPromise.reject('lol error')
const main = proxyquire('../index', {'aws-sdk': AWS})
return main.main('stream name', {})
.then(() => {
assert.equal(console.log.args[0][0], 'lol error')
})
})
})
})

0 comments on commit 7c5de4b

Please sign in to comment.