-
Notifications
You must be signed in to change notification settings - Fork 824
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
fix(mock): handle stack trace & produce meaningful error, resolution messages for mocking API & Func category #12537
Merged
Conversation
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
…essages for mocking API & Func category
manaswi223
commented
Apr 27, 2023
aws-eddy
reviewed
Apr 27, 2023
aws-eddy
reviewed
Apr 27, 2023
packages/amplify-nodejs-function-runtime-provider/src/__tests__/utils/invoke.test.ts
Outdated
Show resolved
Hide resolved
aws-eddy
reviewed
Apr 27, 2023
AaronZyLee
suggested changes
Apr 27, 2023
packages/amplify-nodejs-function-runtime-provider/src/__tests__/utils/invoke.test.ts
Outdated
Show resolved
Hide resolved
phani-srikar
requested changes
Apr 28, 2023
AaronZyLee
previously approved these changes
Apr 28, 2023
danielleadams
changed the title
fix(mock)-handle stack trace & produce meaningful error, resolution messages for mocking API & Func category
fix(mock): handle stack trace & produce meaningful error, resolution messages for mocking API & Func category
Apr 28, 2023
AaronZyLee
approved these changes
Apr 28, 2023
phani-srikar
approved these changes
Apr 28, 2023
For the second case, "No AppSync API is added to the project and mocking API" error messaging, it doesn't seem like the resolution of Update: Disregard my comment, your code does not represent the screenshots in the PR description 😄 |
aws-eddy
approved these changes
May 1, 2023
Good to merge once E2E tests pass. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
This PR allows mocking API category & Function category to produce meaningful
Error:
Resolution:
andLink:
to documentation wherever applicable while failing on scenarios like:amplify mock api
in an uninitialized project throws with a stack trace amplify-category-api#1324amplify mock api
throws an error with a stack trace if@function
specifies a function name that does not exist amplify-category-api#1390Elaborate examples of above scenarios and outputs produced before & after the PR:
steps:
amplify init -y
amplify add api
> GraphQL > accept defaultsgit clone git init; git clean -fXd
amplify mock api
Before the PR:
after the PR:
steps:
amplify init
amplify mock api
before the PR:
after the PR:
steps:
amplify init -y
amplify add api
> GraphQL > choose blank schemaamplify mock api
before the PR:
after the PR:
schema:
steps:
amplify init -y
amplify add api
> GraphQLcopy the schema from the description above, where the function doesn’t exist
amplify mock api
observe error
before the PR:
after the PR:
Issue #, if available
Description of how you validated changes
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.