UNPKG

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.

48 lines (47 loc) 1.58 kB
#!/usr/bin/env node declare const _exports: { appRoot: string; opts: import("commander").OptionValues; /** * Main control flow */ main(): void | Promise<void>; /** * -i, --init: Initialize some samples & a .runtime.js in the mock directory */ init(): Promise<void>; /** * -j, --inject <app-entry-file>: Inject .runtime.js into the specified entry relative to the working directory. */ inject(): Promise<void>; /** * -w, --watch [command]: * Watch mock directory & update .runtime.js. If the [command] is specified, * ths specified command will be executed together with watching.' */ watch(): Promise<void>; /** * -p, --proxy [mode]: *'Proxy mode. In proxy mode, http-request-mock will start a proxy server which receives * incoming requests on localhost. The mock files will be run in a nodejs environment. * This feature is designed for browser, so do not use it in a nodjs project. * Note: proxy mode is still under experimental stage, only for experts. * [matched] All requests matched by @url will be proxied to a proxy server. */ proxy(): void; /** * Ask for input * @param {string} question */ askInput(question: string): Promise<any>; /** * Copy some samples into the specified mock directory. * @param {string} mockDirectory */ copySampleFiles(mockDirectory: string): void; /** * Set command line options */ setOptions(): import("commander").OptionValues; }; export = _exports;