-
Notifications
You must be signed in to change notification settings - Fork 62
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: build type and graphql statement generation #757
Conversation
packages/amplify-codegen-e2e-tests/src/__tests__/build-app-swift.test.ts
Show resolved
Hide resolved
await apiGqlCompile(projectRoot); | ||
await generateModels(projectRoot); | ||
await generateStatementsAndTypes(projectRoot); | ||
writeFileSync(path.join(projectRoot, statementsDir, 'mutations.graphql'), 'foo\nbar'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: comma at the end to ;
await generateStatementsAndTypes(projectRoot); | ||
writeFileSync(path.join(projectRoot, statementsDir, 'mutations.graphql'), 'foo\nbar'), | ||
expect(() => parse(readFileSync(path.join(projectRoot, statementsDir, 'mutations.graphql'), 'utf8'))).toThrowError(); | ||
await androidBuild(projectRoot, { ...config }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this build is expected to fail right? Since we're adding invalid GQL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The android compilation won't fail in this case because the GraphQL statements are generated with raw GraphQL syntax. Line 108 covers the failure. Line 109 isn't really needed in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not needed, is there a reason we don't just remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment, otherwise LGTM
Description of changes
Test building an app after generating graphql statements and types.
Issue #, if available
N/A
Description of how you validated changes
Run the tests: https://us-east-1.console.aws.amazon.com/codesuite/codebuild/594813022831/projects/amplify-codegen-e2e-workflow/batch/amplify-codegen-e2e-workflow:0a304923-d204-44dd-9a2c-42e65de590d2?region=us-east-1
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.