You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MockUrlFetcher maps URLs to an Object representing the expected JSON response.
Currently, adding a new URL requires adding a new method/if statement to the code. Instead, we could have a folder called tests/mockUrls with files like http-crandb.r-pkg.org-gsl.json with the expected JSON content. MockUrlFetcher would then just look for a file matching the URL and return a 404 if no match was found. That would make it easier to add/update the expected JSON as we add new fixtured e.g.
This is a good idea. I did this for the NPM information but in the interest of getting the tests fixed quickly I reverted to the if-statement approach.
The
MockUrlFetcher
maps URLs to anObject
representing the expected JSON response.Currently, adding a new URL requires adding a new method/if statement to the code. Instead, we could have a folder called
tests/mockUrls
with files likehttp-crandb.r-pkg.org-gsl.json
with the expected JSON content.MockUrlFetcher
would then just look for a file matching the URL and return a 404 if no match was found. That would make it easier to add/update the expected JSON as we add new fixtured e.g.The text was updated successfully, but these errors were encountered: