huturen / http-request-mock

Intercept & mock http requests issued by XMLHttpRequest, fetch, nodejs https/http module, axios, jquery, superagent, ky, node-fetch, request, got or any other request libraries by intercepting XMLHttpRequest, fetch and nodejs native requests at low level.

Home Page:https://huturen.github.io/http-request-mock-docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set delay option globally?

raphaelsoul opened this issue · comments

as mentioned.

Use at tag @delay like below:

/**
 * @url https://jsonplaceholder.typicode.com/todos/1
 * @delay  100
 */
module.exports =  (requestInfo) => {
  return 'Your mocking data';
};

For more at tags, please refer to the link below:

https://github.com/huturen/http-request-mock#Mock-data-file