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

Adds unit tests for relayOperationGenericsRule #4

Merged
merged 4 commits into from
Oct 21, 2018
Merged

Adds unit tests for relayOperationGenericsRule #4

merged 4 commits into from
Oct 21, 2018

Conversation

ashfurrow
Copy link
Member

This PR adds unit tests for the relayOperationGenericsRule added in #1. Fixes #2. Also updates the readme.

I played around with snapshot tests but didn't like how far apart the source for linting in the test and the results were. It's more clear here that the fix is adding the import and the type parameter.

We can move applyRuleToSourceText, applyRuleFixes, and ruleOptions into their own testHelpers.ts, but I wanted to get one test in as a proof-of-concept before adding CI, and then adding more rules.

Copy link
Member

@alloy alloy left a comment

Choose a reason for hiding this comment

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

Very nice tests!

Helps enforce type safety and adherence to TypeScript/Relay conventions.
Helps enforce type safety and adherence to the following TypeScript/Relay conventions:

- `QueryRenderer` components must include type parameters (includes fix).
Copy link
Member

Choose a reason for hiding this comment

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

While not test yet, this rule and fix also applies to commitMutation.

@alloy alloy merged commit 5de4146 into master Oct 21, 2018
@ashfurrow ashfurrow deleted the testing branch October 21, 2018 15:23
ashfurrow added a commit that referenced this pull request Oct 21, 2018
This was referenced Oct 21, 2018
ashfurrow added a commit that referenced this pull request Oct 21, 2018
Adds more tests, follow-up from #4.
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.

Figure out testing
2 participants