Reputation: 22478
Is there an equivalent to webmock or vcr for client side code? ... Or is it possible to use webmock with client side code already?
Upvotes: 7
Views: 1927
Reputation: 13216
Nowadays, try Mockttp.
It can mock requests for both Node & browser, it uses real requests thereby giving you far more accurate results than Nock et al, and it can either mock as a fake server (reconfiguring your target URLs) or an intercepting proxy (making requests to the real URLs, and intercepting some/all of them).
It's also got good support for running tests in parallel, which global-mocking libraries can't do, and lots of other nice modern features.
Upvotes: 0
Reputation: 774
Upvotes: 0