UNPKG

nock

Version:

HTTP server mocking and expectations library for Node.js

26 lines (25 loc) • 1.4 kB
import type { Interceptor } from './interceptor.ts'; import type { Scope } from './scope.ts'; import * as common from './common.ts'; declare function enableNetConnect(matcher?: string | RegExp | ((host: string) => boolean)): void; declare function isEnabledForNetConnect(url: string): boolean; declare function disableNetConnect(): void; declare function isOn(): boolean; declare function addInterceptor(key: string, interceptor: Interceptor, scope: Scope, scopeOptions: Record<string, any>, host: string): void; declare function remove(interceptor: Interceptor): void; declare function removeAll(): void; declare function interceptorsFor(url: URL): any; declare function removeInterceptor(options: Interceptor | { proto?: string; host?: string; method?: string; path?: string; }): boolean; declare function isDone(): boolean; declare function pendingMocks(): string[]; declare function activeMocks(): string[]; declare function activate(): void; declare function deactivate(): void; declare const isActiveFn: () => boolean; declare const abortPendingRequests: typeof common.removeAllTimers; export { addInterceptor, remove, removeAll, removeInterceptor, isOn, activate, isActiveFn as isActive, isDone, pendingMocks, activeMocks, enableNetConnect, disableNetConnect, deactivate as restoreOverriddenClientRequest, abortPendingRequests, interceptorsFor, isEnabledForNetConnect, };