Created
July 24, 2020 06:45
-
-
Save maatthc/bb927efbd868d80e2ece40528a2211db to your computer and use it in GitHub Desktop.
How to easily mock multiple AWS services using Jest - JavaScript
This file contains 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
jest.mock('aws-sdk', () => { | |
return { | |
SSM: jest.fn(() => ({ | |
getParameter: jest.fn(() => ({ | |
promise: jest.fn().mockResolvedValue({ Parameter: { Value: 'SECRET-KEY' } }), | |
})), | |
})), | |
SQS: jest.fn(() => ({})), | |
S3: jest.fn(() => ({})), | |
SNS: jest.fn(() => ({})), | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment