RFC: Add unmock to cloud.spec.browser.ts. #273
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.
Request for comments on a new testing library that could replace
nock
in testing HTTP traffic.Tests in
cloud.spec.browser.ts
define a nock scope for every endpoint separately.Unmock intercepts all traffic by default and relies on service specification (like OpenAPI) to verify requests and serve back mock data.
Hi!
I'm one of the authors of unmock.io, a new open-source API testing library that I'm building with some colleagues. We are looking for repos where we feel unmock could reduce lines of code and increase clarity, and we thought that yours might be a good candidate.
The idea of unmock is that you drop in your service contract like an OpenAPI, Swagger, or RAML specification, and unmock then intercepts traffic and serves back semantically correct mock data for the service hit with request. I could not find any specification for
cloud.filestackapi.com
so I created a mock spec from scratch for the testing purposes. If such a specification existed, one could drop all the nock scope mocks for different endpoints and rely on the spec to (1) verify outgoing requests are valid and (2) be served back data of correct type so the handling of responses can be tested.It'd be great if you could check out the PR and give us your thoughts - we hope you like it!