Christian Schlensker
Christian Schlensker

Reputation: 22478

Is there an equivalent to webmock for testing client side code

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

Answers (3)

Tim Perry
Tim Perry

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

Milovan Zogovic
Milovan Zogovic

Reputation: 1580

You can use sinon's FakeXMLHttpRequest, or nock.

Upvotes: 3

Related Questions