MCPcopy Create free account

hub / github.com/mswjs/interceptors / functions

Functions345 in github.com/mswjs/interceptors

↓ 488 callersMethodon
* Listen to the interceptor's public events.
src/Interceptor.ts:148
↓ 313 callersMethodget
()
src/interceptors/fetch/utils/decompression.ts:18
↓ 239 callersMethodsend
* Send the data from the server to this client.
src/interceptors/WebSocket/WebSocketTransport.ts:33
↓ 207 callersMethodapply
* Apply this interceptor to the current process. * Returns an already running interceptor instance if it's present.
src/Interceptor.ts:78
↓ 195 callersMethodrespondWith
(response: Response)
src/RequestController.ts:7
↓ 183 callersMethodaddEventListener
( event: EventType, listener: StrictEventListenerOrEventListenerObject< WebSocketTransportEventM
src/interceptors/WebSocket/WebSocketTransport.ts:18
↓ 155 callersMethoddispose
* Disposes of any side-effects this interceptor has introduced.
src/Interceptor.ts:194
↓ 150 callersMethodclose
()
_http_common.d.ts:48
↓ 141 callersMethodonce
( event: EventName, listener: Listener<Events[EventName]> )
src/Interceptor.ts:168
↓ 128 callersFunctionwaitForClientRequest
( request: http.ClientRequest )
test/helpers.ts:288
↓ 120 callersFunctionfetch
( info: RequestInfo | URL, init?: RequestInit )
test/helpers.ts:119
↓ 109 callersMethodend
(...args: Array<unknown>)
src/interceptors/Socket/MockSocket.ts:46
↓ 86 callersFunctionloadExample
({ webpackServer, page }, use)
test/playwright.extend.ts:29
↓ 82 callersFunctioncreateXMLHttpRequest
( middleware: (req: XMLHttpRequest) => void )
test/helpers.ts:155
↓ 74 callersMethodremoveAllListeners
( event?: EventName )
src/Interceptor.ts:184
↓ 71 callersMethodstatus
(nextStatus: number)
src/utils/createProxy.test.ts:64
↓ 45 callersMethodemit
(event: string | symbol, ...args: any[])
src/interceptors/ClientRequest/MockHttpSocket.ts:157
↓ 45 callersFunctiongetWsUrl
(ws: WebSocketServer)
test/modules/WebSocket/utils/getWsUrl.ts:4
↓ 44 callersMethodpush
(chunk: any, encoding?: BufferEncoding)
src/interceptors/Socket/MockSocket.ts:54
↓ 42 callersMethodwrite
(...args: Array<unknown>)
src/interceptors/Socket/MockSocket.ts:38
↓ 39 callersMethodclone
* Safely clones the given `Response`. * Coerces response clone exceptions into 500 mocked responses. * Handy in the environments that introduce
src/utils/fetchUtils.ts:265
↓ 30 callersMethodconnect
()
src/interceptors/Socket/MockSocket.ts:31
↓ 27 callersMethoddispatchEvent
( event: WebSocketTransportEventMap[EventType] )
src/interceptors/WebSocket/WebSocketTransport.ts:26
↓ 27 callersFunctiongetRawFetchHeaders
(headers: Headers)
src/interceptors/ClientRequest/utils/recordRawHeaders.ts:268
↓ 27 callersFunctionnormalizeClientRequestArgs
( defaultProtocol: string, args: ClientRequestArgs )
src/interceptors/ClientRequest/utils/normalizeClientRequestArgs.ts:113
↓ 26 callersFunctionsleep
(duration: number)
test/helpers.ts:309
↓ 24 callersMethoderrorWith
(reason?: unknown)
src/RequestController.ts:8
↓ 24 callersFunctiongetBodyByteLength
( input: Request | Response )
src/interceptors/XMLHttpRequest/utils/getBodyByteLength.ts:5
↓ 22 callersFunctionrecordRawFetchHeaders
()
src/interceptors/ClientRequest/utils/recordRawHeaders.ts:74
↓ 20 callersMethodapplyPatch
( owner: Owner, key: K, getNextValue: (realValue: Owner[K]) => Owner[K] )
src/utils/patchesRegistry.ts:6
↓ 20 callersFunctionwaitForWebSocketEvent
( type: Type, ws: WebSocket )
test/modules/WebSocket/utils/waitForWebSocketEvent.ts:7
↓ 19 callersFunctionbindEvent
( target: T, event: E )
src/interceptors/WebSocket/utils/bindEvent.ts:3
↓ 19 callersFunctiongetUrlByRequestOptions
(options: ResolvedRequestOptions)
src/utils/getUrlByRequestOptions.ts:111
↓ 16 callersMethoddestroy
(error?: Error | undefined)
src/interceptors/ClientRequest/MockHttpSocket.ts:168
↓ 15 callersFunctioncallXMLHttpRequest
({ page }, use)
test/playwright.extend.ts:52
↓ 15 callersFunctionisObject
(value: any, loose = false)
src/utils/isObject.ts:4
↓ 15 callersFunctionwaitForNextTick
()
test/modules/WebSocket/utils/waitForNextTick.ts:1
↓ 14 callersFunctioncreateProxy
( target: Target, options: ProxyOptions<Target> )
src/utils/createProxy.ts:25
↓ 12 callersFunctioncallFetch
( page: Page, url: string, init: RequestInit = {} )
test/modules/fetch/intercept/fetch.browser.test.ts:24
↓ 12 callersFunctionhasConfigurableGlobal
( propertyName: keyof typeof globalThis )
src/utils/hasConfigurableGlobal.ts:7
↓ 12 callersMethodpreventDefault
()
src/interceptors/WebSocket/utils/events.ts:89
↓ 11 callersMethodtrigger
* Triggers given event on the `XMLHttpRequest` instance.
src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts:625
↓ 10 callersFunctionnormalizeSocketWriteArgs
( args: WriteArgs )
src/interceptors/Socket/utils/normalizeSocketWriteArgs.ts:17
↓ 9 callersFunctiongetIncomingMessageBody
( response: IncomingMessage )
src/interceptors/ClientRequest/utils/getIncomingMessageBody.ts:8
↓ 8 callersFunctioncompressResponse
( codings: Array<'gzip' | 'x-gzip' | 'deflate' | 'br'>, input: string )
test/helpers.ts:326
↓ 8 callersFunctionnext
()
src/utils/createProxy.ts:48
↓ 7 callersFunctioncreateNetworkError
(cause?: unknown)
src/interceptors/fetch/utils/createNetworkError.ts:1
↓ 7 callersFunctionencodeBuffer
(text: string)
src/utils/bufferUtils.ts:3
↓ 7 callersFunctiongetHttpServerHost
(server: http.Server)
test/modules/WebSocket/third-party/socket.io.send.bypass.test.ts:35
↓ 7 callersFunctiongetValueBySymbol
( symbolName: string, source: object )
src/utils/getValueBySymbol.ts:4
↓ 7 callersFunctionhttpGet
( url: string, options: RequestOptions = {} )
test/helpers.ts:21
↓ 6 callersFunctioncloneObject
( obj: ObjectType )
src/utils/cloneObject.ts:17
↓ 6 callersMethodclose
* Close the client connection.
src/interceptors/WebSocket/WebSocketTransport.ts:38
↓ 6 callersFunctiondefine
( target: object, property: string | symbol, value: unknown )
src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts:736
↓ 6 callersFunctionemitAsync
( emitter: Emitter<Events>, eventName: EventName, ...data: Events[EventName] )
src/utils/emitAsync.ts:8
↓ 6 callersMethodremoveEventListener
( type: K, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerO
src/interceptors/WebSocket/WebSocketOverride.ts:233
↓ 5 callersMethodcreateConnection
(options: any, callback: any)
src/interceptors/ClientRequest/agents.ts:20
↓ 5 callersFunctioncreateRequestId
()
src/createRequestId.ts:7
↓ 5 callersFunctionensureRawHeadersSymbol
* Define the raw headers symbol on the given `Headers` instance. * If the symbol already exists, this function does nothing.
src/interceptors/ClientRequest/utils/recordRawHeaders.ts:34
↓ 5 callersFunctionforwardServerUrls
(page: Page)
test/modules/fetch/response/fetch.browser.test.ts:33
↓ 5 callersFunctionforwardServerUrls
(page: Page)
test/modules/XMLHttpRequest/response/xhr.browser.test.ts:23
↓ 5 callersFunctiongetGlobalSymbol
(symbol: Symbol)
src/Interceptor.ts:17
↓ 5 callersFunctiongetRawRequest
(request: Request)
src/getRawRequest.ts:15
↓ 5 callersFunctiongetRequestBody
(page: Page)
test/modules/fetch/intercept/fetch.body.browser.test.ts:17
↓ 5 callersFunctionisPropertyAccessible
( obj: Obj, key: keyof Obj )
src/utils/isPropertyAccessible.ts:9
↓ 5 callersMethodresponseBufferToText
()
src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts:471
↓ 5 callersMethodsetUrl
(url: string | undefined, response: Response)
src/utils/fetchUtils.ts:218
↓ 4 callersMethodaddEventListener
( type: unknown, listener: unknown, options?: unknown )
src/interceptors/WebSocket/WebSocketOverride.ts:221
↓ 4 callersFunctionarrayWith
(length: number, mapFn: (index: number) => V)
test/modules/http/http-performance.test.ts:9
↓ 4 callersFunctionfindPropertySource
( target: object, propertyName: string | symbol )
src/utils/findPropertySource.ts:5
↓ 4 callersFunctiongetCleanUrl
(url: URL, isAbsolute: boolean = true)
src/utils/getCleanUrl.ts:4
↓ 4 callersFunctionhandleRequest
( options: HandleRequestOptions )
src/utils/handleRequest.ts:23
↓ 4 callersFunctionisResponseError
(response: unknown)
src/utils/responseUtils.ts:38
↓ 4 callersFunctionnext
()
test/modules/fetch/fetch-memory-worker.js:40
↓ 4 callersMethodread
()
src/interceptors/ClientRequest/MockHttpSocket.ts:372
↓ 4 callersMethodsetReadyState
* Transitions this request's `readyState` to the given one.
src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts:599
↓ 4 callersFunctionspyOnEvents
(req: XMLHttpRequest, listener: Mock)
test/modules/XMLHttpRequest/compliance/xhr-events-order.test.ts:37
↓ 3 callersFunctioncallback
()
src/interceptors/Socket/utils/normalizeSocketWriteArgs.test.ts:39
↓ 3 callersFunctioncreateEvent
( target: XMLHttpRequest | XMLHttpRequestUpload, type: string, init?: ProgressEventInit )
src/interceptors/XMLHttpRequest/utils/createEvent.ts:6
↓ 3 callersFunctioncreateMockResponse
()
test/third-party/axios.test.ts:9
↓ 3 callersFunctiondecodeBuffer
(buffer: ArrayBuffer, encoding?: string)
src/utils/bufferUtils.ts:7
↓ 3 callersFunctionextractRequestFromPage
(page: Page)
test/helpers.ts:193
↓ 3 callersMethodgetName
()
src/utils/cloneObject.test.ts:63
↓ 3 callersFunctioninferRawHeaders
* Infers the raw headers from the given `HeadersInit` provided * to the Request/Response constructor. * * If the `init.headers` is a Headers instan
src/interceptors/ClientRequest/utils/recordRawHeaders.ts:289
↓ 3 callersMethodisResponseWithBody
* Returns a boolean indicating whether the given response status * code represents a response that can have a body.
src/utils/fetchUtils.ts:187
↓ 3 callersFunctionparseContentEncoding
(contentEncoding: string)
src/interceptors/fetch/utils/decompression.ts:25
↓ 3 callersFunctionparseJson
(data: string)
src/utils/parseJson.ts:5
↓ 3 callersMethodpassthrough
()
src/RequestController.ts:6
↓ 3 callersFunctionresolveCallback
( args: ClientRequestArgs )
src/interceptors/ClientRequest/utils/normalizeClientRequestArgs.ts:97
↓ 3 callersFunctionresolveRequestOptions
( args: ClientRequestArgs, url: URL )
src/interceptors/ClientRequest/utils/normalizeClientRequestArgs.ts:42
↓ 3 callersFunctionrestoreHeadersPrototype
()
src/interceptors/ClientRequest/utils/recordRawHeaders.ts:260
↓ 3 callersFunctionsetRawRequest
(request: Request, rawRequest: unknown)
src/getRawRequest.ts:19
↓ 3 callersMethodsetup
* Setup the module augments and stubs necessary for this interceptor. * This method is not run if there's a running interceptor instance * to pr
src/Interceptor.ts:143
↓ 3 callersFunctiontoArrayBuffer
(array: Uint8Array)
src/utils/bufferUtils.ts:17
↓ 2 callersMethod#resolveProperty
( input: RequestInfo | URL, init: FetchRequestInit = {}, key: T )
src/utils/fetchUtils.ts:12
↓ 2 callersMethod#setInternalProperty
( key: T, value: Request[T] )
src/utils/fetchUtils.ts:121
↓ 2 callersFunctioncallRawXMLHttpRequest
({ page }, use)
test/playwright.extend.ts:55
↓ 2 callersFunctioncanParseUrl
(url: string)
src/utils/canParseUrl.ts:6
↓ 2 callersFunctionconcatArrayBuffer
( left: Uint8Array, right: Uint8Array )
src/interceptors/XMLHttpRequest/utils/concatArrayBuffer.ts:4
↓ 2 callersFunctioncreateRawBrowserXMLHttpRequest
(page: Page)
test/helpers.ts:226
next →1–100 of 345, ranked by callers