Side by side
MockWebServer vs Pretender.js
Both stand on api mocking tools. Which one you can start free with, which one lets you read the code, and what each costs once you pay.
Free plan Android
MockWebServer offers request capture and controllable responses for basic client tests. Consider its stated scope limit if your testing needs go beyond that, as the project points users toward MockServer.
Visit MockWebServer Free plan Web
Pretender.js provides flexible browser request mocking with route tracking and timing controls. Its browser-only scope makes it unsuitable for use outside the browser.
Visit Pretender.jsThe facts
| MockWebServer | Pretender.js | |
|---|---|---|
| Free plan | Yes | Yes |
| Open source | Not published | Not published |
| Runs on | Android | Web |
| Lowest paid plan | Free or on request | Not published |
| Plans published | 2 | None |
| Maker | Not published | Not published |
| Website | square.github.io | github.com |
| On api mocking tools | #19 of 26 | #23 of 26 |
MockWebServer: what it does well
- Tests HTTP, HTTPS, and HTTP/2 clients.
- Responses can be scripted or dispatched by policy.
- Can simulate slow networks and socket failures.
- Free under Apache License 2.0.
What to know first
- Not a full-featured standalone testing library.
- Not actively developed for new features.
Pretender.js: what it does well
- Supports XMLHttpRequest and Fetch mocks in the browser
- Offers six route methods
- Controls response timing, including manual resolution
- Routes can pass through to native XMLHttpRequest
- MIT license permits use and modification without charge
What to know first
- Works only in the browser
- Temporarily replaces native XMLHttpRequest and Fetch
- Users must call shutdown() to restore native XMLHttpRequest
Alternatives to MockWebServer Alternatives to Pretender.js The whole list