Created
February 18, 2018 12:04
-
-
Save derikwhittaker/595a596be60d30ad708d9eae22eb230f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const stubs = require('./aws-stubs'); | |
| const AWS = {}; | |
| AWS.config = { | |
| setPromisesDependency: (arg) => {} | |
| }; | |
| AWS.S3 = function() { | |
| } | |
| AWS.S3.prototype = { | |
| ...AWS.S3.prototype, | |
| // Stub for the listObjectsV2 method in the sdk | |
| listObjectsV2(params){ | |
| const stubPromise = new Promise((resolve, reject) => { | |
| resolve(stubs.listObjects); | |
| }); | |
| return { | |
| promise: () => { | |
| return stubPromise; | |
| } | |
| } | |
| } | |
| }; | |
| module.exports = AWS; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Derik, I tried following the same thing as per your blog post with following as my
aws-sdk.tsin the__mock__dirhowever I get following error on the file where aws sdk is being imported.