FREEDOM251

Freedom251 › Compare

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.

MockWebServer

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

Pretender.js

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.js

The facts

MockWebServerPretender.js
Free planYesYes
Open sourceNot publishedNot published
Runs onAndroidWeb
Lowest paid planFree or on requestNot published
Plans published2None
MakerNot publishedNot published
Websitesquare.github.iogithub.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