Created
June 12, 2024 19:57
-
-
Save piclez/f4b6cc0fb206649d24e915dfec1a6e7e to your computer and use it in GitHub Desktop.
Lambda Handler Test
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
const { handler } = require('./handler'); | |
jest.mock("@sentry/node", () => ({ | |
init: () => jest.fn(), | |
wrapHandler: () => jest.fn(), | |
})); | |
describe('handler', () => { | |
it('should return the correct response', async () => { | |
const event = { | |
input: { | |
error: { | |
Error: 'Exception Error', | |
} | |
} | |
}; | |
const response = await handler(event); | |
expect(response).toBe(JSON.stringify('Exception Error')); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment