http-request-mock
Version:
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 in low level.
19 lines (17 loc) • 376 B
JavaScript
/**
* @url https://some.api.com/dynamic
* @header content-type: application/json
* @method get
*/
/* eslint-disable */
const faker = require("http-request-mock/plugin/faker.js");
module.exports = (request) => {
return {
ret: 0,
msg: "ok",
name: faker.name(),
email: faker.email(),
phone: faker.phone("1-###-###-####"),
url: request.url,
};
}