Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/wheresrhys/fetch-mock
/ functions
Functions
137 in github.com/wheresrhys/fetch-mock
⨍
Functions
137
◇
Types & classes
23
↓ 230 callers
Method
fetchHandler
( this: FetchMock, requestInput: string | URL | Request, requestInit?: RequestInit, )
packages/fetch-mock/src/FetchMock.ts:100
↓ 196 callers
Method
route
( matcher: RouteMatcher | UserRouteConfig | RouteConfigWrapper, response?: RouteResponse, options?: User
packages/fetch-mock/src/FetchMock.ts:132
↓ 46 callers
Method
catch
(response?: RouteResponse)
packages/fetch-mock/src/FetchMock.ts:141
↓ 44 callers
Method
createInstance
()
packages/fetch-mock/src/FetchMock.ts:97
↓ 35 callers
Method
done
(routeNames?: RouteName | RouteName[])
packages/fetch-mock/src/CallHistory.ts:135
↓ 32 callers
Method
mockGlobal
(this: FetchMock)
packages/fetch-mock/src/FetchMock.ts:166
↓ 31 callers
Method
calls
(filter?: CallHistoryFilter, options?: RouteConfig)
packages/fetch-mock/src/CallHistory.ts:79
↓ 29 callers
Method
called
(filter?: CallHistoryFilter, options?: RouteConfig)
packages/fetch-mock/src/CallHistory.ts:125
↓ 28 callers
Function
expectCodemodResult
( src, expected, fetchMockVariableName = 'fetchMock', )
packages/codemods/src/__tests__/method-codemods.test.js:7
↓ 25 callers
Function
expectCodemodResult
(src, expected)
packages/codemods/src/__tests__/option-codemods.test.js:7
↓ 19 callers
Method
of
(value: any)
packages/fetch-mock/src/TypeDescriptor.ts:62
↓ 14 callers
Function
constructFormData
(props = { foo: 'bar' })
packages/fetch-mock/src/__tests__/Matchers/body.test.js:257
↓ 14 callers
Function
defineShorthand
( shorthandOptions: UserRouteConfig | RouteConfigWrapper, )
packages/fetch-mock/src/FetchMock.ts:39
↓ 13 callers
Method
removeRoutes
({ names, includeSticky, includeFallback, }: RemoveRouteOptions = {})
packages/fetch-mock/src/Router.ts:409
↓ 10 callers
Method
clearHistory
()
packages/fetch-mock/src/FetchMock.ts:162
↓ 10 callers
Method
flush
(waitForResponseMethods?: boolean)
packages/fetch-mock/src/CallHistory.ts:66
↓ 10 callers
Method
isArray
(value: any)
packages/fetch-mock/src/TypeDescriptor.ts:107
↓ 10 callers
Method
mockReset
(options: MockResetOptions = { includeSticky: false })
packages/jest/src/index.ts:20
↓ 10 callers
Method
mockReset
(options: MockResetOptions = { includeSticky: false })
packages/vitest/src/index.ts:19
↓ 10 callers
Method
mockRestore
(options?: MockResetOptions)
packages/jest/src/index.ts:27
↓ 9 callers
Function
expectSingleUrl
(...filter)
packages/fetch-mock/src/__tests__/CallHistory.test.js:257
↓ 9 callers
Method
modifyRoute
(routeName: string, options: ModifyRouteConfig)
packages/fetch-mock/src/Router.ts:429
↓ 7 callers
Function
expectCodemodResult
(src, expected)
packages/codemods/src/__tests__/identifying-fetchmock-instances.test.js:5
↓ 7 callers
Function
testChainableRoutingMethod
(method, ...args)
packages/fetch-mock/src/__tests__/FetchMock/routing.test.js:22
↓ 7 callers
Method
unmockGlobal
(this: FetchMock)
packages/fetch-mock/src/FetchMock.ts:170
↓ 6 callers
Function
codemod
(source, variableName)
packages/codemods/src/index.js:32
↓ 6 callers
Function
getDelayedAbortController
(delay)
packages/fetch-mock/src/__tests__/FetchMock/response-negotiation.test.js:246
↓ 6 callers
Method
lastCall
( filter?: CallHistoryFilter, options?: RouteConfig, )
packages/fetch-mock/src/CallHistory.ts:128
↓ 6 callers
Method
mockClear
()
packages/jest/src/index.ts:16
↓ 6 callers
Method
mockClear
()
packages/vitest/src/index.ts:15
↓ 6 callers
Method
spy
( this: FetchMock, matcher?: RouteMatcher | UserRouteConfig | RouteConfigWrapper, name?: RouteName, )
packages/fetch-mock/src/FetchMock.ts:182
↓ 5 callers
Method
abort
()
packages/fetch-mock/src/Router.ts:161
↓ 5 callers
Function
getFetchMockFromInput
(input: PatchedFetch | FetchMock)
packages/jest/src/jest-extensions.ts:16
↓ 5 callers
Function
getFetchMockFromInput
(input: PatchedFetch | FetchMock)
packages/vitest/src/vitest-extensions.ts:18
↓ 5 callers
Function
getPath
(url: string)
packages/fetch-mock/src/RequestUtils.ts:121
↓ 5 callers
Method
isObject
(value: any)
packages/fetch-mock/src/TypeDescriptor.ts:127
↓ 5 callers
Function
normalizeHeaders
( headers: HeadersInit | { [key: string]: string | number }, )
packages/fetch-mock/src/RequestUtils.ts:144
↓ 4 callers
Method
clear
()
packages/fetch-mock/src/CallHistory.ts:57
↓ 4 callers
Function
fetchTheseUrls
(...urls)
packages/fetch-mock/src/__tests__/CallHistory.test.js:11
↓ 4 callers
Method
mockRestore
(options?: MockResetOptions)
packages/vitest/src/index.ts:26
↓ 4 callers
Function
normalizeUrl
( url: string | String | URL, allowRelativeUrls: boolean, )
packages/fetch-mock/src/RequestUtils.ts:25
↓ 4 callers
Function
testChainableMethod
(method, ...args)
packages/fetch-mock/src/__tests__/FetchMock/mock-and-spy.test.js:14
↓ 3 callers
Function
appendError
(message, path)
packages/codemods/src/codemods/options.js:5
↓ 3 callers
Method
defineMatcher
(matcher: MatcherDefinition)
packages/fetch-mock/src/Route.ts:311
↓ 3 callers
Method
execute
(callLog: CallLog)
packages/fetch-mock/src/Router.ts:153
↓ 3 callers
Method
isFunction
(value: any)
packages/fetch-mock/src/TypeDescriptor.ts:115
↓ 3 callers
Method
isNull
(value: any)
packages/fetch-mock/src/TypeDescriptor.ts:119
↓ 3 callers
Function
str2ab
(str)
packages/fetch-mock/src/__tests__/FetchMock/response-construction.test.js:75
↓ 3 callers
Function
testChainableMethod
(method, ...args)
packages/fetch-mock/src/__tests__/FetchMock/routing.test.js:10
↓ 2 callers
Function
createCallLogFromRequest
( request: Request, options: RequestInit, )
packages/fetch-mock/src/RequestUtils.ts:89
↓ 2 callers
Function
createPackageJson
(format)
scripts/declare-dist-type.js:7
↓ 2 callers
Function
defineGreedyShorthand
(shorthandOptions: UserRouteConfig)
packages/fetch-mock/src/FetchMock.ts:68
↓ 2 callers
Function
formDataToObject
(formData: FormData)
packages/fetch-mock/src/Matchers.ts:198
↓ 2 callers
Function
getAllChainedMethodCalls
(fetchMockVariableName, root)
packages/codemods/src/codemods/methods.js:3
↓ 2 callers
Function
getFullUrlMatcher
( route: RouteConfig, matcherUrl: string, query: { [key: string]: string }, )
packages/fetch-mock/src/Matchers.ts:266
↓ 2 callers
Function
getQuery
(url: string)
packages/fetch-mock/src/RequestUtils.ts:137
↓ 2 callers
Function
getRegexpMatcher
(regexp: RegExp)
packages/fetch-mock/src/Matchers.ts:262
↓ 2 callers
Method
hardReset
(options?: HardResetOptions)
packages/fetch-mock/src/FetchMock.ts:175
↓ 2 callers
Method
init
(config: RouteConfig | ModifyRouteConfig)
packages/fetch-mock/src/Route.ts:145
↓ 2 callers
Function
isUrlMatcher
( matcher: RouteMatcher | RouteConfig, )
packages/fetch-mock/src/Matchers.ts:36
↓ 2 callers
Function
prependFetchMock
(src)
packages/codemods/src/__tests__/option-codemods.test.js:4
↓ 2 callers
Function
prependFetchMock
(src, fetchMockVariableName)
packages/codemods/src/__tests__/method-codemods.test.js:4
↓ 2 callers
Method
removeRoute
(routeName: string)
packages/fetch-mock/src/FetchMock.ts:152
↓ 2 callers
Method
removeRoutes
(options?: RemoveRouteOptions)
packages/fetch-mock/src/FetchMock.ts:148
↓ 2 callers
Method
spyGlobal
(this: FetchMock)
packages/fetch-mock/src/FetchMock.ts:203
↓ 1 callers
Method
#delayResponse
()
packages/fetch-mock/src/Route.ts:205
↓ 1 callers
Method
#generateMatcher
()
packages/fetch-mock/src/Route.ts:176
↓ 1 callers
Method
#limit
()
packages/fetch-mock/src/Route.ts:188
↓ 1 callers
Method
#sanitize
()
packages/fetch-mock/src/Route.ts:171
↓ 1 callers
Method
#validate
()
packages/fetch-mock/src/Route.ts:156
↓ 1 callers
Function
ab2str
(buf)
packages/fetch-mock/src/__tests__/FetchMock/response-construction.test.js:71
↓ 1 callers
Method
addRoute
( matcher: RouteMatcher | UserRouteConfig, response?: RouteResponse, nameOrOptions?: UserRouteConfig | s
packages/fetch-mock/src/Router.ts:323
↓ 1 callers
Method
constructResponse
(responseInput: RouteResponseConfig)
packages/fetch-mock/src/Route.ts:234
↓ 1 callers
Method
constructResponseBody
( responseInput: RouteResponseConfig, responseOptions: ResponseInitUsingHeaders, )
packages/fetch-mock/src/Route.ts:264
↓ 1 callers
Method
constructResponseOptions
( responseInput: RouteResponseConfig, )
packages/fetch-mock/src/Route.ts:253
↓ 1 callers
Function
createCallLogFromUrlAndOptions
( url: string | String | object, options: RequestInit, )
packages/fetch-mock/src/RequestUtils.ts:57
↓ 1 callers
Method
createObservableResponse
( response: Response, responseConfig: ResponseInit, responseInput: RouteResponseConfig, responseUrl: s
packages/fetch-mock/src/Router.ts:265
↓ 1 callers
Function
findFetchMockVariableName
(root)
packages/codemods/src/index.js:5
↓ 1 callers
Method
from
(value: any)
packages/fetch-mock/src/TypeDescriptor.ts:91
↓ 1 callers
Method
generateResponse
(callLog: CallLog)
packages/fetch-mock/src/Router.ts:241
↓ 1 callers
Function
getHost
(url: string)
packages/fetch-mock/src/RequestUtils.ts:128
↓ 1 callers
Function
hasCredentialsInUrl
(url: string)
packages/fetch-mock/src/RequestUtils.ts:17
↓ 1 callers
Function
importJSDOM
()
packages/fetch-mock/src/__tests__/Matchers/url.test.js:289
↓ 1 callers
Function
isBodyInit
(body: BodyInit | object)
packages/fetch-mock/src/Route.ts:95
↓ 1 callers
Method
isBoolean
(value: any)
packages/fetch-mock/src/TypeDescriptor.ts:111
↓ 1 callers
Function
isFunctionMatcher
( matcher: RouteMatcher | RouteConfig, )
packages/fetch-mock/src/Matchers.ts:43
↓ 1 callers
Function
isMatchedOrUnmatched
( filter: CallHistoryFilter, )
packages/fetch-mock/src/CallHistory.ts:38
↓ 1 callers
Function
isName
(filter: CallHistoryFilter)
packages/fetch-mock/src/CallHistory.ts:33
↓ 1 callers
Method
isNumber
(value: any)
packages/fetch-mock/src/TypeDescriptor.ts:123
↓ 1 callers
Function
isPromise
(response: RouteResponse)
packages/fetch-mock/src/Router.ts:41
↓ 1 callers
Method
isReferenceType
( value: any, )
packages/fetch-mock/src/TypeDescriptor.ts:101
↓ 1 callers
Method
isString
(value: any)
packages/fetch-mock/src/TypeDescriptor.ts:131
↓ 1 callers
Function
isSubsetOf
( subset: any[] | Record<string, any | undefined> | null, superset: any[] | Record<string, any | undefined>
packages/fetch-mock/src/IsSubsetOf.ts:7
↓ 1 callers
Method
isSymbol
(value: any)
packages/fetch-mock/src/TypeDescriptor.ts:135
↓ 1 callers
Method
isUndefined
(value: any)
packages/fetch-mock/src/TypeDescriptor.ts:139
↓ 1 callers
Method
isValueType
( value: any, )
packages/fetch-mock/src/TypeDescriptor.ts:95
↓ 1 callers
Function
manageFetchMockGlobally
(jest: Jest)
packages/jest/src/index.ts:33
↓ 1 callers
Function
manageFetchMockGlobally
()
packages/vitest/src/index.ts:32
↓ 1 callers
Function
nameToOptions
(options: RouteConfig | string)
packages/fetch-mock/src/Router.ts:37
↓ 1 callers
Method
needsToReadBody
(request: Request)
packages/fetch-mock/src/Router.ts:147
next →
1–100 of 137, ranked by callers