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

test(parser): refactor appsync schema tests #3388

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

svozza
Copy link
Contributor

@svozza svozza commented Nov 29, 2024

Summary

As mentioned in #3305, rather than have lots of JSON events that we have to read from the filesystem, we should have one event that we extend/amend to suit each test case. This PR refactors the AppSync schema tests to do this.

Changes

  • Changed tests to read a single event from the file system
  • Added an omit function to packages/parser/tests/unit/schema/utils.ts that allow us to give a list of fields to be omitted from an object. This is useful for testing.invalid schemas so we can can test where properties that must be present are not.

Issue number:
n/a


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@svozza svozza requested review from a team as code owners November 29, 2024 21:02
@boring-cyborg boring-cyborg bot added the tests PRs that add or change tests label Nov 29, 2024
@pull-request-size pull-request-size bot added the size/XL PRs between 500-999 LOC, often PRs that grown with feedback label Nov 29, 2024
@svozza svozza force-pushed the refactor-appsync-schema-tests branch from 7d53e05 to 2d84ccd Compare November 29, 2024 21:18
@svozza svozza force-pushed the refactor-appsync-schema-tests branch from 2d84ccd to 821a5d4 Compare December 9, 2024 15:37
@dreamorosi
Copy link
Contributor

Hi @svozza, we'll try to review this by early next week - thank you for your patience!

@svozza svozza force-pushed the refactor-appsync-schema-tests branch from 821a5d4 to f3a6ad4 Compare December 13, 2024 16:18
@svozza
Copy link
Contributor Author

svozza commented Dec 13, 2024

No worries, I know Re:Invent has taken up most of the team's capacity.

@svozza svozza force-pushed the refactor-appsync-schema-tests branch from f3a6ad4 to 5d49edb Compare December 23, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL PRs between 500-999 LOC, often PRs that grown with feedback tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants