Open nicekiwi opened 6 years ago
Actually it seems calling
var AWS = require('aws-sdk-mock');
on it's own will return the same error.
@nicekiwi how did you resolve this? Getting the same thing.
Hmm, I don't think I ever got this working. Found it easier to write my own mocks. https://github.com/nicekiwi/lowdb-adapter-aws-s3/blob/master/__mocks__/aws-sdk.js
I got this error due to the fact that jest had been used to mock aws-sdk in another test and it was never unmocked. That mock did not contain a config object, and therefore this exception resulted. My advice would be to ensure that aws-sdk is what you expect it to be in your test environment. Once I had ensured aws-sdk was the genuine SDK, aws-sdk-mock worked perfectly.
I got this error similar to @th3morg but I had a __mocks__/aws-sdk.js
defined. once I deleted/renamed mock file, fixed.
If I run the following code with Jest, I get:
The test: