Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/mswjs/interceptors
/ functions
Functions
345 in github.com/mswjs/interceptors
⨍
Functions
345
◇
Types & classes
133
↓ 488 callers
Method
on
* Listen to the interceptor's public events.
src/Interceptor.ts:148
↓ 313 callers
Method
get
()
src/interceptors/fetch/utils/decompression.ts:18
↓ 239 callers
Method
send
* Send the data from the server to this client.
src/interceptors/WebSocket/WebSocketTransport.ts:33
↓ 207 callers
Method
apply
* Apply this interceptor to the current process. * Returns an already running interceptor instance if it's present.
src/Interceptor.ts:78
↓ 195 callers
Method
respondWith
(response: Response)
src/RequestController.ts:7
↓ 183 callers
Method
addEventListener
( event: EventType, listener: StrictEventListenerOrEventListenerObject< WebSocketTransportEventM
src/interceptors/WebSocket/WebSocketTransport.ts:18
↓ 155 callers
Method
dispose
* Disposes of any side-effects this interceptor has introduced.
src/Interceptor.ts:194
↓ 150 callers
Method
close
()
_http_common.d.ts:48
↓ 141 callers
Method
once
( event: EventName, listener: Listener<Events[EventName]> )
src/Interceptor.ts:168
↓ 128 callers
Function
waitForClientRequest
( request: http.ClientRequest )
test/helpers.ts:288
↓ 120 callers
Function
fetch
( info: RequestInfo | URL, init?: RequestInit )
test/helpers.ts:119
↓ 109 callers
Method
end
(...args: Array<unknown>)
src/interceptors/Socket/MockSocket.ts:46
↓ 86 callers
Function
loadExample
({ webpackServer, page }, use)
test/playwright.extend.ts:29
↓ 82 callers
Function
createXMLHttpRequest
( middleware: (req: XMLHttpRequest) => void )
test/helpers.ts:155
↓ 74 callers
Method
removeAllListeners
( event?: EventName )
src/Interceptor.ts:184
↓ 71 callers
Method
status
(nextStatus: number)
src/utils/createProxy.test.ts:64
↓ 45 callers
Method
emit
(event: string | symbol, ...args: any[])
src/interceptors/ClientRequest/MockHttpSocket.ts:157
↓ 45 callers
Function
getWsUrl
(ws: WebSocketServer)
test/modules/WebSocket/utils/getWsUrl.ts:4
↓ 44 callers
Method
push
(chunk: any, encoding?: BufferEncoding)
src/interceptors/Socket/MockSocket.ts:54
↓ 42 callers
Method
write
(...args: Array<unknown>)
src/interceptors/Socket/MockSocket.ts:38
↓ 39 callers
Method
clone
* 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 callers
Method
connect
()
src/interceptors/Socket/MockSocket.ts:31
↓ 27 callers
Method
dispatchEvent
( event: WebSocketTransportEventMap[EventType] )
src/interceptors/WebSocket/WebSocketTransport.ts:26
↓ 27 callers
Function
getRawFetchHeaders
(headers: Headers)
src/interceptors/ClientRequest/utils/recordRawHeaders.ts:268
↓ 27 callers
Function
normalizeClientRequestArgs
( defaultProtocol: string, args: ClientRequestArgs )
src/interceptors/ClientRequest/utils/normalizeClientRequestArgs.ts:113
↓ 26 callers
Function
sleep
(duration: number)
test/helpers.ts:309
↓ 24 callers
Method
errorWith
(reason?: unknown)
src/RequestController.ts:8
↓ 24 callers
Function
getBodyByteLength
( input: Request | Response )
src/interceptors/XMLHttpRequest/utils/getBodyByteLength.ts:5
↓ 22 callers
Function
recordRawFetchHeaders
()
src/interceptors/ClientRequest/utils/recordRawHeaders.ts:74
↓ 20 callers
Method
applyPatch
( owner: Owner, key: K, getNextValue: (realValue: Owner[K]) => Owner[K] )
src/utils/patchesRegistry.ts:6
↓ 20 callers
Function
waitForWebSocketEvent
( type: Type, ws: WebSocket )
test/modules/WebSocket/utils/waitForWebSocketEvent.ts:7
↓ 19 callers
Function
bindEvent
( target: T, event: E )
src/interceptors/WebSocket/utils/bindEvent.ts:3
↓ 19 callers
Function
getUrlByRequestOptions
(options: ResolvedRequestOptions)
src/utils/getUrlByRequestOptions.ts:111
↓ 16 callers
Method
destroy
(error?: Error | undefined)
src/interceptors/ClientRequest/MockHttpSocket.ts:168
↓ 15 callers
Function
callXMLHttpRequest
({ page }, use)
test/playwright.extend.ts:52
↓ 15 callers
Function
isObject
(value: any, loose = false)
src/utils/isObject.ts:4
↓ 15 callers
Function
waitForNextTick
()
test/modules/WebSocket/utils/waitForNextTick.ts:1
↓ 14 callers
Function
createProxy
( target: Target, options: ProxyOptions<Target> )
src/utils/createProxy.ts:25
↓ 12 callers
Function
callFetch
( page: Page, url: string, init: RequestInit = {} )
test/modules/fetch/intercept/fetch.browser.test.ts:24
↓ 12 callers
Function
hasConfigurableGlobal
( propertyName: keyof typeof globalThis )
src/utils/hasConfigurableGlobal.ts:7
↓ 12 callers
Method
preventDefault
()
src/interceptors/WebSocket/utils/events.ts:89
↓ 11 callers
Method
trigger
* Triggers given event on the `XMLHttpRequest` instance.
src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts:625
↓ 10 callers
Function
normalizeSocketWriteArgs
( args: WriteArgs )
src/interceptors/Socket/utils/normalizeSocketWriteArgs.ts:17
↓ 9 callers
Function
getIncomingMessageBody
( response: IncomingMessage )
src/interceptors/ClientRequest/utils/getIncomingMessageBody.ts:8
↓ 8 callers
Function
compressResponse
( codings: Array<'gzip' | 'x-gzip' | 'deflate' | 'br'>, input: string )
test/helpers.ts:326
↓ 8 callers
Function
next
()
src/utils/createProxy.ts:48
↓ 7 callers
Function
createNetworkError
(cause?: unknown)
src/interceptors/fetch/utils/createNetworkError.ts:1
↓ 7 callers
Function
encodeBuffer
(text: string)
src/utils/bufferUtils.ts:3
↓ 7 callers
Function
getHttpServerHost
(server: http.Server)
test/modules/WebSocket/third-party/socket.io.send.bypass.test.ts:35
↓ 7 callers
Function
getValueBySymbol
( symbolName: string, source: object )
src/utils/getValueBySymbol.ts:4
↓ 7 callers
Function
httpGet
( url: string, options: RequestOptions = {} )
test/helpers.ts:21
↓ 6 callers
Function
cloneObject
( obj: ObjectType )
src/utils/cloneObject.ts:17
↓ 6 callers
Method
close
* Close the client connection.
src/interceptors/WebSocket/WebSocketTransport.ts:38
↓ 6 callers
Function
define
( target: object, property: string | symbol, value: unknown )
src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts:736
↓ 6 callers
Function
emitAsync
( emitter: Emitter<Events>, eventName: EventName, ...data: Events[EventName] )
src/utils/emitAsync.ts:8
↓ 6 callers
Method
removeEventListener
( type: K, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerO
src/interceptors/WebSocket/WebSocketOverride.ts:233
↓ 5 callers
Method
createConnection
(options: any, callback: any)
src/interceptors/ClientRequest/agents.ts:20
↓ 5 callers
Function
createRequestId
()
src/createRequestId.ts:7
↓ 5 callers
Function
ensureRawHeadersSymbol
* 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 callers
Function
forwardServerUrls
(page: Page)
test/modules/fetch/response/fetch.browser.test.ts:33
↓ 5 callers
Function
forwardServerUrls
(page: Page)
test/modules/XMLHttpRequest/response/xhr.browser.test.ts:23
↓ 5 callers
Function
getGlobalSymbol
(symbol: Symbol)
src/Interceptor.ts:17
↓ 5 callers
Function
getRawRequest
(request: Request)
src/getRawRequest.ts:15
↓ 5 callers
Function
getRequestBody
(page: Page)
test/modules/fetch/intercept/fetch.body.browser.test.ts:17
↓ 5 callers
Function
isPropertyAccessible
( obj: Obj, key: keyof Obj )
src/utils/isPropertyAccessible.ts:9
↓ 5 callers
Method
responseBufferToText
()
src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts:471
↓ 5 callers
Method
setUrl
(url: string | undefined, response: Response)
src/utils/fetchUtils.ts:218
↓ 4 callers
Method
addEventListener
( type: unknown, listener: unknown, options?: unknown )
src/interceptors/WebSocket/WebSocketOverride.ts:221
↓ 4 callers
Function
arrayWith
(length: number, mapFn: (index: number) => V)
test/modules/http/http-performance.test.ts:9
↓ 4 callers
Function
findPropertySource
( target: object, propertyName: string | symbol )
src/utils/findPropertySource.ts:5
↓ 4 callers
Function
getCleanUrl
(url: URL, isAbsolute: boolean = true)
src/utils/getCleanUrl.ts:4
↓ 4 callers
Function
handleRequest
( options: HandleRequestOptions )
src/utils/handleRequest.ts:23
↓ 4 callers
Function
isResponseError
(response: unknown)
src/utils/responseUtils.ts:38
↓ 4 callers
Function
next
()
test/modules/fetch/fetch-memory-worker.js:40
↓ 4 callers
Method
read
()
src/interceptors/ClientRequest/MockHttpSocket.ts:372
↓ 4 callers
Method
setReadyState
* Transitions this request's `readyState` to the given one.
src/interceptors/XMLHttpRequest/XMLHttpRequestController.ts:599
↓ 4 callers
Function
spyOnEvents
(req: XMLHttpRequest, listener: Mock)
test/modules/XMLHttpRequest/compliance/xhr-events-order.test.ts:37
↓ 3 callers
Function
callback
()
src/interceptors/Socket/utils/normalizeSocketWriteArgs.test.ts:39
↓ 3 callers
Function
createEvent
( target: XMLHttpRequest | XMLHttpRequestUpload, type: string, init?: ProgressEventInit )
src/interceptors/XMLHttpRequest/utils/createEvent.ts:6
↓ 3 callers
Function
createMockResponse
()
test/third-party/axios.test.ts:9
↓ 3 callers
Function
decodeBuffer
(buffer: ArrayBuffer, encoding?: string)
src/utils/bufferUtils.ts:7
↓ 3 callers
Function
extractRequestFromPage
(page: Page)
test/helpers.ts:193
↓ 3 callers
Method
getName
()
src/utils/cloneObject.test.ts:63
↓ 3 callers
Function
inferRawHeaders
* 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 callers
Method
isResponseWithBody
* Returns a boolean indicating whether the given response status * code represents a response that can have a body.
src/utils/fetchUtils.ts:187
↓ 3 callers
Function
parseContentEncoding
(contentEncoding: string)
src/interceptors/fetch/utils/decompression.ts:25
↓ 3 callers
Function
parseJson
(data: string)
src/utils/parseJson.ts:5
↓ 3 callers
Method
passthrough
()
src/RequestController.ts:6
↓ 3 callers
Function
resolveCallback
( args: ClientRequestArgs )
src/interceptors/ClientRequest/utils/normalizeClientRequestArgs.ts:97
↓ 3 callers
Function
resolveRequestOptions
( args: ClientRequestArgs, url: URL )
src/interceptors/ClientRequest/utils/normalizeClientRequestArgs.ts:42
↓ 3 callers
Function
restoreHeadersPrototype
()
src/interceptors/ClientRequest/utils/recordRawHeaders.ts:260
↓ 3 callers
Function
setRawRequest
(request: Request, rawRequest: unknown)
src/getRawRequest.ts:19
↓ 3 callers
Method
setup
* 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 callers
Function
toArrayBuffer
(array: Uint8Array)
src/utils/bufferUtils.ts:17
↓ 2 callers
Method
#resolveProperty
( input: RequestInfo | URL, init: FetchRequestInit = {}, key: T )
src/utils/fetchUtils.ts:12
↓ 2 callers
Method
#setInternalProperty
( key: T, value: Request[T] )
src/utils/fetchUtils.ts:121
↓ 2 callers
Function
callRawXMLHttpRequest
({ page }, use)
test/playwright.extend.ts:55
↓ 2 callers
Function
canParseUrl
(url: string)
src/utils/canParseUrl.ts:6
↓ 2 callers
Function
concatArrayBuffer
( left: Uint8Array, right: Uint8Array )
src/interceptors/XMLHttpRequest/utils/concatArrayBuffer.ts:4
↓ 2 callers
Function
createRawBrowserXMLHttpRequest
(page: Page)
test/helpers.ts:226
next →
1–100 of 345, ranked by callers