Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: lambda.ts test #46

Merged
merged 4 commits into from
Feb 22, 2024
Merged

Tests: lambda.ts test #46

merged 4 commits into from
Feb 22, 2024

Conversation

jasnoo
Copy link
Contributor

@jasnoo jasnoo commented Feb 22, 2024

Updated tsconfig to add "esModuleInterop": true (info here) after seeing warnings during test (alternative is to use __esModule:true as per jest docs to specify individual mocks being esmodules).

Added tests for middyfy function. I wasn't sure what sort of edge cases to think about here so any additional feedback about that would be great.

@jasnoo jasnoo requested a review from namanaman February 22, 2024 20:17
Copy link
Contributor

@namanaman namanaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! Can't think of other test cases, it's a tough one

});
jest.mock('@middy/http-json-body-parser');

const mockMiddy = middy as jest.MockedFunction<typeof middy>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For top-level scope constants, the naming can be MOCK_MIDDY

@jasnoo jasnoo merged commit 2cfee9d into main Feb 22, 2024
1 check passed
@jasnoo jasnoo deleted the test-lambda-lib branch February 22, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants