Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/nock/nock
/ functions
Functions
226 in github.com/nock/nock
⨍
Functions
226
◇
Types & classes
25
↓ 54 callers
Method
get
(uri, requestBody, options)
lib/scope.js:145
↓ 52 callers
Method
reply
( replyFnWithCallback: ( this: ReplyFnContext, uri: string, body: Body,
types/index.d.ts:149
↓ 39 callers
Method
done
()
types/index.d.ts:129
↓ 22 callers
Method
post
(uri, requestBody, options)
lib/scope.js:149
↓ 18 callers
Method
once
()
types/index.d.ts:203
↓ 17 callers
Method
isDone
()
types/index.d.ts:130
↓ 15 callers
Method
write
()
lib/socket.js:43
↓ 12 callers
Method
intercept
(uri, method, requestBody, interceptorOptions)
lib/scope.js:132
↓ 8 callers
Method
destroy
* Denotes that no more I/O activity should happen on this socket. * * The implementation in Node if far more complex as it juggles underlying as
lib/socket.js:88
↓ 8 callers
Function
log
(emitter, name)
examples/_log.js:5
↓ 8 callers
Method
resume
()
lib/socket.js:40
↓ 8 callers
Method
setTimeout
(timeoutMs, fn)
lib/socket.js:53
↓ 7 callers
Method
delayConnection
@deprecated use delay function instead
types/index.d.ts:215
↓ 7 callers
Method
times
(newCounter: number)
types/index.d.ts:202
↓ 6 callers
Method
address
()
lib/socket.js:45
↓ 6 callers
Method
delay
(opts: number)
types/index.d.ts:208
↓ 6 callers
Function
isPlainObject
* Returns true if the given value is a plain object and not an Array. * @param {*} value * @returns {boolean}
lib/common.js:612
↓ 6 callers
Method
pendingMocks
()
types/index.d.ts:131
↓ 6 callers
Method
persist
(flag?: boolean)
types/index.d.ts:125
↓ 6 callers
Method
query
( matcher: | boolean | string | DataMatcherMap | URLSearchParams
types/index.d.ts:136
↓ 6 callers
Method
replyWithFile
( statusCode: StatusCode, fileName: string, headers?: ReplyHeaders, )
types/index.d.ts:193
↓ 6 callers
Function
startHttpServer
(requestListener = defaultRequestListener)
tests/servers/index.js:35
↓ 5 callers
Method
activeMocks
()
types/index.d.ts:132
↓ 5 callers
Method
clear
()
types/index.d.ts:228
↓ 5 callers
Method
filteringRequestBody
(regex: RegExp, replace: string)
types/index.d.ts:120
↓ 5 callers
Method
match
(req, options, body)
lib/interceptor.js:250
↓ 5 callers
Function
nockDone
()
lib/back.js:75
↓ 5 callers
Method
setMode
(mode: BackMode)
types/index.d.ts:263
↓ 4 callers
Method
add
(key, interceptor)
lib/scope.js:105
↓ 4 callers
Method
assertScopesFinished
()
types/index.d.ts:295
↓ 4 callers
Method
clone
()
lib/scope.js:290
↓ 4 callers
Method
delayBody
@deprecated use delay function instead
types/index.d.ts:213
↓ 4 callers
Method
filteringPath
(regex: RegExp, replace: string)
types/index.d.ts:118
↓ 4 callers
Function
isOn
()
lib/intercept.js:97
↓ 3 callers
Function
after
(scope: nock.Scope)
types/tests.ts:761
↓ 3 callers
Method
basicAuth
(options: { user: string; pass?: string })
types/index.d.ts:200
↓ 3 callers
Function
cb
()
tests/test_common.js:492
↓ 3 callers
Method
delete
(uri, requestBody, options)
lib/scope.js:169
↓ 3 callers
Function
interceptorScopes
()
lib/intercept.js:349
↓ 3 callers
Function
isOff
()
lib/intercept.js:101
↓ 3 callers
Function
loadDefs
(path)
lib/scope.js:295
↓ 3 callers
Method
maybeStartPlayback
()
lib/intercepted_request_router.js:252
↓ 3 callers
Method
patch
(uri, requestBody, options)
lib/scope.js:161
↓ 3 callers
Method
play
()
types/index.d.ts:229
↓ 3 callers
Method
rec
(options?: boolean | RecorderOptions)
types/index.d.ts:227
↓ 3 callers
Method
remove
(key, interceptor)
lib/scope.js:119
↓ 3 callers
Method
replyContentLength
()
types/index.d.ts:126
↓ 3 callers
Method
replyWithError
(errorMessage: string | object)
types/index.d.ts:192
↓ 3 callers
Method
times
* Set number of times will repeat the interceptor * @name times * @param newCounter Number of times to repeat (should be > 0) * @public *
lib/interceptor.js:530
↓ 3 callers
Method
twice
()
types/index.d.ts:204
↓ 2 callers
Function
cb
(...callbackArgs)
lib/common.js:527
↓ 2 callers
Function
checkDuration
(start, durationMillis)
tests/got/test_delay.js:23
↓ 2 callers
Function
continueWithResponseBody
(rawBody)
lib/playback_interceptor.js:273
↓ 2 callers
Method
defaultReplyHeaders
(headers: ReplyHeaders)
types/index.d.ts:116
↓ 2 callers
Function
define
(nockDefs)
lib/scope.js:350
↓ 2 callers
Function
expand
lib/common.js:643
↓ 2 callers
Function
fixtureExists
(fixture)
lib/back.js:300
↓ 2 callers
Function
getBodyFromChunks
(chunks, headers)
lib/recorder.js:28
↓ 2 callers
Function
getMethod
(options)
lib/recorder.js:24
↓ 2 callers
Function
getScope
(options)
lib/recorder.js:19
↓ 2 callers
Method
head
(uri, requestBody, options)
lib/scope.js:157
↓ 2 callers
Function
interceptorsFor
* Return all the Interceptors whose Scopes match against the base path of the provided options. * * @returns {Interceptor[]}
lib/intercept.js:154
↓ 2 callers
Function
isEnabledForNetConnect
(options)
lib/intercept.js:79
↓ 2 callers
Method
matchHeader
(name: string, value: RequestHeaderMatcher)
types/index.d.ts:117
↓ 2 callers
Method
merge
(uri, requestBody, options)
lib/scope.js:165
↓ 2 callers
Method
optionally
(flag?: boolean)
types/index.d.ts:206
↓ 2 callers
Method
options
(uri, requestBody, options)
lib/scope.js:173
↓ 2 callers
Method
pendingMocks
()
lib/scope.js:180
↓ 2 callers
Method
put
(uri, requestBody, options)
lib/scope.js:153
↓ 2 callers
Method
replyDate
(d?: Date)
types/index.d.ts:127
↓ 2 callers
Function
restoreOverriddenClientRequest
()
lib/intercept.js:329
↓ 2 callers
Method
shouldPersist
* @private * @returns {boolean}
lib/scope.js:276
↓ 2 callers
Method
thrice
()
types/index.d.ts:205
↓ 2 callers
Function
urlToOptions
* Utility function that converts a URL object into an ordinary * options object as expected by the http.request and https.request APIs. * * This wa
lib/common.js:449
↓ 1 callers
Function
activate
()
lib/intercept.js:369
↓ 1 callers
Method
activeMocks
()
lib/scope.js:192
↓ 1 callers
Function
addHeaderLine
* Set key/value data in accordance with Node's logic for folding duplicate headers. * * The `value` param should be a function, string, or array of
lib/common.js:247
↓ 1 callers
Function
addInterceptor
(key, interceptor, scope, scopeOptions, host)
lib/intercept.js:105
↓ 1 callers
Method
applyDelay
* Artificial delay that will trip socket timeouts when appropriate. * * Doesn't actually wait for time to pass. * Timeout events don't necess
lib/socket.js:68
↓ 1 callers
Function
applyHook
(scopes, fn)
lib/back.js:288
↓ 1 callers
Function
assertScopes
(scopes, fixture)
lib/back.js:308
↓ 1 callers
Method
attachToReq
()
lib/intercepted_request_router.js:76
↓ 1 callers
Function
before
(scope)
tests/got/test_back_filters.js:35
↓ 1 callers
Function
clearTimer
(clear, ids)
lib/common.js:543
↓ 1 callers
Method
connectSocket
()
lib/intercepted_request_router.js:107
↓ 1 callers
Function
convertBodyToStream
(body)
lib/playback_interceptor.js:92
↓ 1 callers
Function
createResponse
* @param {import('http').IncomingMessage} message * @param {AbortSignal} signal
lib/create_response.js:21
↓ 1 callers
Function
deepEqual
* Performs a recursive strict comparison between two values. * * Expected values or leaf nodes of expected object values that are RegExp use test()
lib/common.js:496
↓ 1 callers
Method
delayConnection
* Delay the connection by a certain number of ms. * * @param {integer} ms - Number of milliseconds to wait * @return {Interceptor} - the cur
lib/interceptor.js:617
↓ 1 callers
Function
disableNetConnect
* Disable all real requests. * @public * @example * nock.disableNetConnect();
lib/intercept.js:93
↓ 1 callers
Function
enableNetConnect
* Enabled real request. * @public * @param {String|RegExp} matcher=RegExp.new('.*') Expression to match * @example * // Enables all real requests
lib/intercept.js:67
↓ 1 callers
Function
extractLines
(chunks)
tests/got/test_logging.js:91
↓ 1 callers
Function
forEachHeader
* Utility for iterating over a raw headers array. * * The callback is called with: * - The header value. string, array of strings, or a function
lib/common.js:314
↓ 1 callers
Function
getFixtureContent
()
tests/got/test_back_filters.js:19
↓ 1 callers
Method
getPeerCertificate
()
lib/socket.js:75
↓ 1 callers
Function
getScopeFromDefinition
(nockDef)
lib/scope.js:323
↓ 1 callers
Function
getStatusFromDefinition
(nockDef)
lib/scope.js:308
↓ 1 callers
Method
handleEnd
(chunk, encoding, callback)
lib/intercepted_request_router.js:190
↓ 1 callers
Method
handleFlushHeaders
()
lib/intercepted_request_router.js:216
↓ 1 callers
Method
handleWrite
(...args)
lib/intercepted_request_router.js:141
next →
1–100 of 226, ranked by callers