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.
13 lines (12 loc) • 442 B
TypeScript
import MockItem from './mock-item';
import Mocker from './mocker';
export default class MockerForNode extends Mocker {
constructor(proxyServer?: string);
/**
* Note: this method is only for a nodejs environment.
* Use a mock file & add it to global mock data configuration.
* @param {string} file
* @param {boolean} returnTags
*/
use(file: string, returnTags?: boolean): false | Partial<MockItem>;
}