RFC: Add unmock to cloud.spec.browser.ts.#273
Open
ksaaskil wants to merge 2 commits intofilestack:masterfrom
Open
RFC: Add unmock to cloud.spec.browser.ts.#273ksaaskil wants to merge 2 commits intofilestack:masterfrom
ksaaskil wants to merge 2 commits intofilestack:masterfrom
Conversation
* Add unmock to a single file. * Clean-up. * Clean spec.
- Also fix a few unmock tests
Codecov Report
@@ Coverage Diff @@
## master #273 +/- ##
==========================================
- Coverage 99.1% 98.96% -0.14%
==========================================
Files 32 32
Lines 1456 1456
Branches 210 270 +60
==========================================
- Hits 1443 1441 -2
- Misses 13 15 +2
Continue to review full report at Codecov.
|
Contributor
|
Hi a quite cool tool for testing APIs, I will look into it when I will find some time. Thanks for PR |
23394d8 to
30e0038
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
nockin testing HTTP traffic.Tests in
cloud.spec.browser.tsdefine 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.comso 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!