Introducing
The Slant team built an AI & it’s awesome
Find the best product instantly
Add to Chrome
Add to Edge
Add to Firefox
Add to Opera
Add to Brave
Add to Safari
Try it now
4.7 star rating
0
Development
What are the best Node.js HTTP mocking libraries?
2
Options
Considered
2
User
Recs.
Oct 11, 2019
Last
Updated
Related Questions
Activity
Have feedback or ideas?
Join our community
on Discord
Ad
2
Options
Considered
Best Node.js HTTP mocking libraries
Price
Last Updated
--
Mockttp
-
Oct 11, 2019
--
nock
-
Oct 11, 2019
See Full List
--
Mockttp
My Rec
ommendation
for
Mockttp
My Recommendation for
Mockttp
All
3
Pros
3
Top
Pro
•••
Lots of debugging support
Unmatched requests fail with a 503 response automatically, and include a detailed explanation of why they didn't match, along with example code you can use to match them. Enabled the debug option adds logging for every received request, showing which rule it matched and why, and making it super easy to tell why your tests are failing.
See More
Top
Pro
•••
Uses a real HTTP server
Using real HTTP or HTTPS makes testing much more accurate, since it shows the exact real behaviour that will happen when your requests are sent, and allows testing a much wider variety of cases (e.g. subprocesses). No noticeable slowdown - localhost servers are still effectively as fast and reliable as doing it in process, since the traffic never leaves your machine.
See More
Top
Pro
•••
Universal client
Mock HTTP with the same code for both browsers & node.js
See More
Hide
See All
Get it
here
Recommend
1
--
nock
My Rec
ommendation
for
nock
My Recommendation for
nock
All
2
Cons
2
Top
Con
•••
Doesn't work in browser JS, it's node only
See More
Top
Con
•••
Can be inaccurate
It's possible to have tests that pass in Nock, but will fail with real HTTP, because it's a manually built simulation of HTTP rather than the real thing.
See More
Hide
Get it
here
Recommend
1
Don't see your favorite option? Add it.
Built By the Slant team
Find the best product instantly.
4.7 star rating
Add to Chrome
Add to Edge
Add to Firefox
Add to Opera
Add to Brave
Add to Safari
Try it now - it's free
One sec!
Are you sure that you want to abandon your hard work?
Delete Work
Continue working
{}
undefined
url next
price drop