Skip to content

Instantly share code, notes, and snippets.

@lennym
Created July 28, 2016 13:53
Show Gist options
  • Save lennym/93f0b9803d30fa2dc3b5a1e609bb8d56 to your computer and use it in GitHub Desktop.
Save lennym/93f0b9803d30fa2dc3b5a1e609bb8d56 to your computer and use it in GitHub Desktop.
const simple = require('simple-mock');
const AWS = require('aws-sdk');
const S3 = (new AWS.S3()).constructor.prototype;
describe('store', () => {
beforeEach(() => {
simple.mock(S3, 'getObject').callbackWith(null, mockResult);
});
afterEach(() => {
simple.restore();
});
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment