Unit testing Headers and Cognito Authorizer #424
Unanswered
leo-suspensify
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
What is the recommended flow write unit tests involving headers and cognito authorization? The objective is to write unit tests which mimic frontend requests passing through the http api gateway. For example, suppose we have the function
We can set a few things beside the body, such as query parameters with
request.with_query_string_parameters
but I don't see how to set headers or Cognito related parameters. This issue mentions that the CognitoIdentity parameters are deprecated and cannot be used inContext
, but there also isn't a clear way to set the RequestContext for mocking. What is the recommended way to do this?Beta Was this translation helpful? Give feedback.
All reactions