Introduction

2023-7-13 Less than 1 minute

It mocks http requests issued by axios, jquery, superagent, node-fetch, got, (… you name it) by intercepting XMLHttpRequest, fetch, and nodejs native HTTP/HTTPS module requests at the low level.

  1. XMLHttpRequest
  2. fetch
  3. https.request, https.get (nodejs native https request)
  4. http.request, http.get (nodejs native http request)
  5. wx.request

Because of the low-level interception, any 3th-party request libraries that based on the above requests can also be supported, such as:

axios, jquery, superagent, ky, node-fetch, got, request ...

layers-design

It differs from the other mocking libraries in that it provides a webpack plugin and command line tool to separate mock data from your business code. It's a truly non-hacking mocking library. You never have to hack into your business code to mock something ever again after a one-time configuration.

Last update: July 13, 2023 22:53