Skip to content

Instantly share code, notes, and snippets.

@marat-chardymov
Last active February 18, 2019 03:45
Show Gist options
  • Save marat-chardymov/de460699b81b2307b60f531bfa35b9d8 to your computer and use it in GitHub Desktop.
Save marat-chardymov/de460699b81b2307b60f531bfa35b9d8 to your computer and use it in GitHub Desktop.
Sinon.js : How to stub any instance of a class
const kinesisResponse = {
FailedRecordCount: 0,
Records: [{ SequenceNumber: 'test-sequence-number', ShardId: 'test-ShardId' }],
};
sinon.stub(KinesisClient.prototype, 'recordToKinesisStream').returns(Promise.resolve(kinesisResponse))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment