[Solved] Mocking A HTTP Rest API for Tests

I wondered if someone knows of an easy way to mock a REST API?
I am calling it using the HTTP package with post, patch and get requests. And looking for a way to test the methods with meteortesting: mocha as the driver. I would love it if I could test it without connecting to an external source, just locally.

Did u try sinon.stub(HTTP, ‘call’) ?

1 Like

Nope! Looks interesting though, I’ll give it a try. Thanks!

I ended up using Nock in the end. It is very easy to use and specificly designed for my problem. Thanks again!