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
↓ 1 callers
Method
isDone
()
lib/scope.js:196
↓ 1 callers
Function
load
(fixture, options)
lib/back.js:235
↓ 1 callers
Function
makeRequest
(url, options = {})
tests/test_abort_signal.js:9
↓ 1 callers
Function
makeRequest
tests/got/test_intercept_parallel.js:13
↓ 1 callers
Function
mapValues
(object, cb)
lib/match_body.js:64
↓ 1 callers
Function
mapValuesDeep
* Based on lodash issue discussion * https://github.com/lodash/lodash/issues/1244
lib/match_body.js:77
↓ 1 callers
Method
markConsumed
()
lib/interceptor.js:452
↓ 1 callers
Method
matchHeader
(name, value)
lib/scope.js:253
↓ 1 callers
Method
matchHeader
(name, value)
lib/interceptor.js:462
↓ 1 callers
Method
matchHostName
(options)
lib/interceptor.js:418
↓ 1 callers
Method
matchOrigin
* Return true when the interceptor's method, protocol, host, port, and path * match the provided options.
lib/interceptor.js:383
↓ 1 callers
Method
matchQuery
(options)
lib/interceptor.js:428
↓ 1 callers
Function
nockBackWithFixture
(mochaDone, scopesLoaded)
tests/test_back.js:47
↓ 1 callers
Function
nockBackWithFixtureLocalhost
(mochaDone)
tests/test_back.js:70
↓ 1 callers
Function
normalizeOrigin
* In WHATWG URL vernacular, this returns the origin portion of a URL. * However, the port is not included if it's standard and not already present on
lib/common.js:58
↓ 1 callers
Function
normalizeUrl
* Normalizes the passed url for consistent internal processing * @param {string|LegacyUrl|URL} u
lib/scope.js:27
↓ 1 callers
Function
overrideClientRequest
()
lib/intercept.js:252
↓ 1 callers
Function
parseFullReplyResult
(response, fullReplyResult)
lib/playback_interceptor.js:23
↓ 1 callers
Function
parseJSONRequestBody
(req, requestBody)
lib/playback_interceptor.js:9
↓ 1 callers
Function
playbackInterceptor
* Play back an interceptor using the given request and mock response.
lib/playback_interceptor.js:115
↓ 1 callers
Function
prepareResponseHeaders
(body)
lib/playback_interceptor.js:243
↓ 1 callers
Method
query
* Set query strings for the interceptor * @name query * @param queries Object of query string name,values (accepts regexp values) * @public
lib/interceptor.js:482
↓ 1 callers
Function
readFile
()
examples/binary-reply.js:7
↓ 1 callers
Function
recordResponse
(mswRequest, mswResponse)
lib/recorder.js:257
↓ 1 callers
Method
ref
()
lib/socket.js:41
↓ 1 callers
Function
remove
(interceptor)
lib/intercept.js:123
↓ 1 callers
Function
removeFixture
(fixture, options)
lib/back.js:274
↓ 1 callers
Method
reply
(statusCode, body, rawHeaders)
lib/interceptor.js:114
↓ 1 callers
Method
reqheaderMatches
(options, key)
lib/interceptor.js:215
↓ 1 callers
Function
resolvesInAtLeast
(promise, durationMillis)
tests/got/test_delay.js:16
↓ 1 callers
Function
selectDefaultHeaders
* Determine which of the default headers should be added to the response. * * Don't include any defaults whose case-insensitive keys are already on
lib/playback_interceptor.js:54
↓ 1 callers
Method
setHostHeaderUsingInterceptor
* Set request headers of the given request. This is needed both during the * routing phase, in case header filters were specified, and during the
lib/intercepted_request_router.js:227
↓ 1 callers
Method
setKeepAlive
()
lib/socket.js:39
↓ 1 callers
Method
setNoDelay
()
lib/socket.js:38
↓ 1 callers
Function
socketOnClose
(req)
lib/intercepted_request_router.js:11
↓ 1 callers
Function
somethingBad
()
tests/got/test_nock_lifecycle.js:190
↓ 1 callers
Function
start
()
lib/playback_interceptor.js:126
↓ 1 callers
Method
startPlayback
()
lib/intercepted_request_router.js:267
↓ 1 callers
Function
tryJsonParse
(string)
lib/scope.js:342
↓ 1 callers
Method
unref
()
lib/socket.js:42
↓ 1 callers
Function
wrapTimer
(timer, ids)
lib/common.js:525
Function
Back
* nock the current function with the fixture given * * @param {string} fixtureName - the name of the fixture, e.x. 'foo.json' * @param {object}
lib/back.js:46
Function
Constructor
()
tests/got/test_stream.js:103
Function
Foo
()
tests/test_common.js:542
Function
NetConnectNotAllowedError
* @name NetConnectNotAllowedError * @private * @desc Error trying to make a connection when disabled external access. * @class * @example * nock.
lib/intercept.js:35
Function
OverriddenClientRequest
(...args)
lib/intercept.js:262
Method
_read
(_size)
lib/playback_interceptor.js:82
Method
_read
(size)
tests/test_socket.js:86
Function
activeMocks
()
lib/intercept.js:365
Function
afterRecord
()
tests/test_back.js:402
Method
basicAuth
({ user, pass = '' })
lib/interceptor.js:467
Function
before
(def: nock.Definition)
types/tests.ts:755
Function
blocklistFilter
(part)
lib/common.js:631
Method
buildFilter
()
lib/scope.js:211
Function
cancel
()
lib/create_response.js:33
Function
clear
()
lib/recorder.js:341
Method
constructor
(basePath, options)
lib/scope.js:74
Method
constructor
(options)
lib/socket.js:7
Method
constructor
* * Valid argument types for `uri`: * - A string used for strict comparisons with pathname. * The search portion of the URI may also be p
lib/interceptor.js:29
Method
constructor
({ req, options, interceptors })
lib/intercepted_request_router.js:31
Method
constructor
(buffers, opts = {})
lib/playback_interceptor.js:76
Method
constructor
(content)
tests/test_socket.js:80
Function
contentEncoding
(headers, encoder)
lib/common.js:102
Function
continueWithFullResponse
(fullReplyResult)
lib/playback_interceptor.js:231
Function
convertFetchRequestToClientRequest
* @param {Request} request
lib/common.js:585
Function
dataEqual
(expected, actual)
lib/common.js:481
Method
defaultReplyHeaders
(headers)
lib/scope.js:259
Function
defaultRequestListener
(req, res)
tests/servers/index.js:29
Method
delay
* Delay the response by a certain number of ms. * * @param {(integer|object)} opts - Number of milliseconds to wait, or an object * @param {i
lib/interceptor.js:584
Method
delayBody
* Delay the response body by a certain number of ms. * * @param {integer} ms - Number of milliseconds to wait before response is sent * @retu
lib/interceptor.js:606
Function
deleteHeadersField
* Deletes the given `fieldName` property from `headers` object by performing * case-insensitive search through keys. * * @headers {Object} header
lib/common.js:289
Method
done
()
lib/scope.js:204
Method
filteringPath
()
lib/scope.js:233
Method
filteringPath
(...args)
lib/interceptor.js:444
Method
filteringRequestBody
()
lib/scope.js:243
Function
formatQueryValue
* Formats a query parameter. * * @param key The key of the query parameter to format. * @param value The value of the q
lib/common.js:364
Function
generateRequestAndResponse
({ req, bodyChunks, options, res, dataChunks, reqheaders, })
lib/recorder.js:96
Function
generateRequestAndResponseObject
({ req, bodyChunks, options, res, dataChunks, reqheaders, })
lib/recorder.js:66
Function
headersArrayToObject
* Converts an array of raw headers to an object, using the same rules as Nodes `http.IncomingMessage.headers`. * * Header names/keys are lower-cased
lib/common.js:192
Function
headersFieldNamesToLowerCase
* Return a new object with all field names of the headers lower-cased. * * Duplicates throw an error.
lib/common.js:118
Function
headersFieldsArrayToLowerCase
lib/common.js:143
Function
headersInputToRawArray
* Converts the various accepted formats of headers into a flat array representing "raw headers". * * Nock allows headers to be provided as a raw arr
lib/common.js:157
Function
ignore
()
tests/got/test_events.js:11
Function
isActive
()
lib/intercept.js:345
Function
isContentEncoded
(headers)
lib/common.js:97
Function
isDone
()
lib/intercept.js:357
Function
isJSONContent
(headers)
lib/common.js:107
Function
isRequestDestroyed
* Check if the Client Request has been cancelled. * * Until Node 14 is the minimum, we need to look at both flags to see if the request has been can
lib/common.js:574
Function
isStream
(obj)
lib/common.js:403
Function
isUtf8Representable
* Returns true if the data contained in buffer can be reconstructed * from its utf8 representation. * * @param {Object} buffer - a Buffer object
lib/common.js:48
Function
load
(path)
lib/scope.js:304
Method
matchHeader
(name: string, value: RequestHeaderMatcher)
types/index.d.ts:199
Function
matchOrigin
()
lib/intercept.js:190
Function
matchStringOrRegexp
(target, pattern)
lib/common.js:342
Function
normalizeClientRequestArgs
* Converts the arguments from the various signatures of http[s].request into a standard * options object and an optional callback function. * * htt
lib/common.js:421
Function
normalizeRequestOptions
* Normalizes the request options so that it always has `host` property. * * @param {Object} options - a parsed options object of the request
lib/common.js:14
Function
nullAppender
(content: string)
types/tests.ts:720
Function
onTimeout
()
tests/test_socket.js:33
Method
once
* An sugar syntax for times(1) * @name once * @see {@link times} * @public * @example * nock('http://zombo.com).get('/').once().reply(2
lib/interceptor.js:548
Method
optionally
(flag = true)
lib/interceptor.js:91
← previous
next →
101–200 of 226, ranked by callers