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.
Currently anyone can request a discount code and redeem free swag. This resolves that by
await
ing the response fromisGitHubContributor
.api.gatsbyjs.org/routes/store.mjs
Line 21 in 8a4b73b
I've added some tests to hopefully catch any regressions. I'm not 💯happy with my tests. I refactored the mocks and fixtures for
@octokit/rest
in or to be more reusable. I would have preferred if I could have gotten the whole class auto mocked by jest and then add amockImplementation
forsearch.issues
, but I couldn't get it working because it's a class. I might be able to take another crack at it with fresh eyes tomorrow.The added
routes/store
tests work, but I'm not super happy with them either. I tried to test the router directly by calling express'router.handle
function. The nice thing about it is that we don't have to spin up the app using something likesupertest
, but the downside is the callback-y-ness.I wanted to submit the PR before heading off to bed, so I may do some refactoring tomorrow but I wanted to get your thoughts.