Bump the npm group with 5 updates (#1951)
* Bump the npm group with 5 updates Bumps the npm group with 5 updates: | Package | From | To | | --- | --- | --- | | [@types/js-yaml](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/js-yaml) | `4.0.6` | `4.0.7` | | [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) | `10.0.17` | `10.0.19` | | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `6.7.5` | `6.8.0` | | [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `6.7.5` | `6.8.0` | | [nock](https://github.com/nock/nock) | `13.3.3` | `13.3.4` | Updates `@types/js-yaml` from 4.0.6 to 4.0.7 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/js-yaml) Updates `@types/sinon` from 10.0.17 to 10.0.19 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon) Updates `@typescript-eslint/eslint-plugin` from 6.7.5 to 6.8.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.8.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 6.7.5 to 6.8.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.8.0/packages/parser) Updates `nock` from 13.3.3 to 13.3.4 - [Release notes](https://github.com/nock/nock/releases) - [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md) - [Commits](https://github.com/nock/nock/compare/v13.3.3...v13.3.4) --- updated-dependencies: - dependency-name: "@types/js-yaml" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm - dependency-name: "@types/sinon" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: npm - dependency-name: nock dependency-type: direct:development update-type: version-update:semver-patch dependency-group: npm ... Signed-off-by: dependabot[bot] <support@github.com> * Update checked-in dependencies --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
d859d17bdb
commit
1d83e52e9a
282 changed files with 1307 additions and 2954 deletions
6
node_modules/nock/README.md
generated
vendored
6
node_modules/nock/README.md
generated
vendored
|
|
@ -1142,7 +1142,7 @@ nock.enableNetConnect(/(amazon|github)\.com/)
|
|||
|
||||
// Or a Function
|
||||
nock.enableNetConnect(
|
||||
host => host.includes('amazon.com') || host.includes('github.com')
|
||||
host => host.includes('amazon.com') || host.includes('github.com'),
|
||||
)
|
||||
|
||||
http.get('http://www.amazon.com/')
|
||||
|
|
@ -1248,7 +1248,7 @@ nocks.forEach(function (nock) {
|
|||
/(timestamp):([0-9]+)/g,
|
||||
function (match, key, value) {
|
||||
return key + ':' + recordedTimestamp
|
||||
}
|
||||
},
|
||||
)
|
||||
} else {
|
||||
return body
|
||||
|
|
@ -1467,7 +1467,7 @@ function prepareScope(scope) {
|
|||
const recordedTimestamp = recordedBodyResult[1]
|
||||
return body.replace(
|
||||
/(timestamp):([0-9]+)/g,
|
||||
(match, key, value) => `${key}:${recordedTimestamp}`
|
||||
(match, key, value) => `${key}:${recordedTimestamp}`,
|
||||
)
|
||||
} else {
|
||||
return body
|
||||
|
|
|
|||
6
node_modules/nock/lib/back.js
generated
vendored
6
node_modules/nock/lib/back.js
generated
vendored
|
|
@ -49,7 +49,7 @@ function Back(fixtureName, options, nockedFn) {
|
|||
throw new Error(
|
||||
'Back requires nock.back.fixtures to be set\n' +
|
||||
'Ex:\n' +
|
||||
"\trequire(nock).back.fixtures = '/path/to/fixtures/'"
|
||||
"\trequire(nock).back.fixtures = '/path/to/fixtures/'",
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -300,8 +300,8 @@ function assertScopes(scopes, fixture) {
|
|||
format(
|
||||
'%j was not used, consider removing %s to rerecord fixture',
|
||||
[].concat(...pending),
|
||||
fixture
|
||||
)
|
||||
fixture,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
14
node_modules/nock/lib/common.js
generated
vendored
14
node_modules/nock/lib/common.js
generated
vendored
|
|
@ -81,7 +81,7 @@ function overrideRequests(newRequest) {
|
|||
|
||||
if (requestOverrides[moduleName]) {
|
||||
throw new Error(
|
||||
`Module's request already overridden for ${moduleName} protocol.`
|
||||
`Module's request already overridden for ${moduleName} protocol.`,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ function restoreOverriddenRequests() {
|
|||
module.request = request
|
||||
module.get = get
|
||||
debug('- restored request for', proto)
|
||||
}
|
||||
},
|
||||
)
|
||||
requestOverrides = {}
|
||||
}
|
||||
|
|
@ -206,11 +206,11 @@ function headersFieldNamesToLowerCase(headers, throwOnDuplicate) {
|
|||
if (lowerCaseHeaders[key] !== undefined) {
|
||||
if (throwOnDuplicate) {
|
||||
throw Error(
|
||||
`Failed to convert header keys to lower case due to field name conflict: ${key}`
|
||||
`Failed to convert header keys to lower case due to field name conflict: ${key}`,
|
||||
)
|
||||
} else {
|
||||
debug(
|
||||
`Duplicate header provided in request: ${key}. Only the last value can be matched.`
|
||||
`Duplicate header provided in request: ${key}. Only the last value can be matched.`,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -244,7 +244,7 @@ function headersInputToRawArray(headers) {
|
|||
// but throw an error if there aren't an even number of items in the array
|
||||
if (headers.length % 2) {
|
||||
throw new Error(
|
||||
`Raw headers must be provided as an array with an even number of items. [fieldName, value, ...]`
|
||||
`Raw headers must be provided as an array with an even number of items. [fieldName, value, ...]`,
|
||||
)
|
||||
}
|
||||
return [...headers]
|
||||
|
|
@ -260,7 +260,7 @@ function headersInputToRawArray(headers) {
|
|||
}
|
||||
|
||||
throw new Error(
|
||||
`Headers must be provided as an array of raw values, a Map, or a plain Object. ${headers}`
|
||||
`Headers must be provided as an array of raw values, a Map, or a plain Object. ${headers}`,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -600,7 +600,7 @@ function deepEqual(expected, actual) {
|
|||
|
||||
if (isPlainObject(expected) && isPlainObject(actual)) {
|
||||
const allKeys = Array.from(
|
||||
new Set(Object.keys(expected).concat(Object.keys(actual)))
|
||||
new Set(Object.keys(expected).concat(Object.keys(actual))),
|
||||
)
|
||||
|
||||
return allKeys.every(key => deepEqual(expected[key], actual[key]))
|
||||
|
|
|
|||
20
node_modules/nock/lib/intercept.js
generated
vendored
20
node_modules/nock/lib/intercept.js
generated
vendored
|
|
@ -151,7 +151,7 @@ function interceptorsFor(options) {
|
|||
|
||||
// First try to use filteringScope if any of the interceptors has it defined.
|
||||
for (const { key, interceptors, allowUnmocked } of Object.values(
|
||||
allInterceptors
|
||||
allInterceptors,
|
||||
)) {
|
||||
for (const interceptor of interceptors) {
|
||||
const { filteringScope } = interceptor.__nock_scopeOptions
|
||||
|
|
@ -185,7 +185,7 @@ function interceptorsFor(options) {
|
|||
debug(
|
||||
`matched base path (${interceptors.length} interceptor${
|
||||
interceptors.length > 1 ? 's' : ''
|
||||
})`
|
||||
})`,
|
||||
)
|
||||
return interceptors
|
||||
}
|
||||
|
|
@ -243,7 +243,7 @@ function ErroringClientRequest(error) {
|
|||
process.nextTick(
|
||||
function () {
|
||||
this.emit('error', error)
|
||||
}.bind(this)
|
||||
}.bind(this),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -272,7 +272,7 @@ function overrideClientRequest() {
|
|||
// https://github.com/nock/nock/pull/1386
|
||||
// https://github.com/nock/nock/pull/1440
|
||||
throw Error(
|
||||
'Creating a ClientRequest with empty `options` is not supported in Nock'
|
||||
'Creating a ClientRequest with empty `options` is not supported in Nock',
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -308,10 +308,10 @@ function overrideClientRequest() {
|
|||
function () {
|
||||
const error = new NetConnectNotAllowedError(
|
||||
options.host,
|
||||
options.path
|
||||
options.path,
|
||||
)
|
||||
this.emit('error', error)
|
||||
}.bind(this)
|
||||
}.bind(this),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -348,7 +348,7 @@ function isActive() {
|
|||
|
||||
function interceptorScopes() {
|
||||
const nestedInterceptors = Object.values(allInterceptors).map(
|
||||
i => i.interceptors
|
||||
i => i.interceptors,
|
||||
)
|
||||
return [].concat(...nestedInterceptors).map(i => i.scope)
|
||||
}
|
||||
|
|
@ -389,7 +389,7 @@ function activate() {
|
|||
// https://github.com/nock/nock/pull/1386
|
||||
// https://github.com/nock/nock/pull/1440
|
||||
throw Error(
|
||||
'Making a request with empty `options` is not supported in Nock'
|
||||
'Making a request with empty `options` is not supported in Nock',
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -402,10 +402,10 @@ function activate() {
|
|||
|
||||
if (isOn() && interceptors) {
|
||||
const matches = interceptors.some(interceptor =>
|
||||
interceptor.matchOrigin(options)
|
||||
interceptor.matchOrigin(options),
|
||||
)
|
||||
const allowUnmocked = interceptors.some(
|
||||
interceptor => interceptor.options.allowUnmocked
|
||||
interceptor => interceptor.options.allowUnmocked,
|
||||
)
|
||||
|
||||
if (!matches && allowUnmocked) {
|
||||
|
|
|
|||
12
node_modules/nock/lib/intercepted_request_router.js
generated
vendored
12
node_modules/nock/lib/intercepted_request_router.js
generated
vendored
|
|
@ -42,7 +42,7 @@ class InterceptedRequestRouter {
|
|||
// We use lower-case header field names throughout Nock.
|
||||
headers: common.headersFieldNamesToLowerCase(
|
||||
options.headers || {},
|
||||
false
|
||||
false,
|
||||
),
|
||||
}
|
||||
this.interceptors = interceptors
|
||||
|
|
@ -89,7 +89,7 @@ class InterceptedRequestRouter {
|
|||
req.setHeader(
|
||||
// We use lower-case header field names throughout Nock.
|
||||
'authorization',
|
||||
`Basic ${Buffer.from(options.auth).toString('base64')}`
|
||||
`Basic ${Buffer.from(options.auth).toString('base64')}`,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -297,16 +297,16 @@ class InterceptedRequestRouter {
|
|||
const requestBodyIsUtf8Representable =
|
||||
common.isUtf8Representable(requestBodyBuffer)
|
||||
const requestBodyString = requestBodyBuffer.toString(
|
||||
requestBodyIsUtf8Representable ? 'utf8' : 'hex'
|
||||
requestBodyIsUtf8Representable ? 'utf8' : 'hex',
|
||||
)
|
||||
|
||||
const matchedInterceptor = interceptors.find(i =>
|
||||
i.match(req, options, requestBodyString)
|
||||
i.match(req, options, requestBodyString),
|
||||
)
|
||||
|
||||
if (matchedInterceptor) {
|
||||
matchedInterceptor.scope.logger(
|
||||
'interceptor identified, starting mocking'
|
||||
'interceptor identified, starting mocking',
|
||||
)
|
||||
|
||||
matchedInterceptor.markConsumed()
|
||||
|
|
@ -329,7 +329,7 @@ class InterceptedRequestRouter {
|
|||
|
||||
// Try to find a hostname match that allows unmocked.
|
||||
const allowUnmocked = interceptors.some(
|
||||
i => i.matchHostName(options) && i.options.allowUnmocked
|
||||
i => i.matchHostName(options) && i.options.allowUnmocked,
|
||||
)
|
||||
|
||||
if (allowUnmocked && req instanceof ClientRequest) {
|
||||
|
|
|
|||
28
node_modules/nock/lib/interceptor.js
generated
vendored
28
node_modules/nock/lib/interceptor.js
generated
vendored
|
|
@ -39,13 +39,13 @@ module.exports = class Interceptor {
|
|||
!uri.startsWith('*')
|
||||
) {
|
||||
throw Error(
|
||||
`Non-wildcard URL path strings must begin with a slash (otherwise they won't match anything) (got: ${uri})`
|
||||
`Non-wildcard URL path strings must begin with a slash (otherwise they won't match anything) (got: ${uri})`,
|
||||
)
|
||||
}
|
||||
|
||||
if (!method) {
|
||||
throw new Error(
|
||||
'The "method" parameter is required for an intercept call.'
|
||||
'The "method" parameter is required for an intercept call.',
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -67,10 +67,10 @@ module.exports = class Interceptor {
|
|||
// We use lower-case header field names throughout Nock.
|
||||
this.reqheaders = common.headersFieldNamesToLowerCase(
|
||||
scope.scopeOptions.reqheaders || {},
|
||||
true
|
||||
true,
|
||||
)
|
||||
this.badheaders = common.headersFieldsArrayToLowerCase(
|
||||
scope.scopeOptions.badheaders || []
|
||||
scope.scopeOptions.badheaders || [],
|
||||
)
|
||||
|
||||
this.delayBodyInMs = 0
|
||||
|
|
@ -118,7 +118,7 @@ module.exports = class Interceptor {
|
|||
// It's not very Javascript-y to throw an error for extra args to a function, but because
|
||||
// of legacy behavior, this error was added to reduce confusion for those migrating.
|
||||
throw Error(
|
||||
'Invalid arguments. When providing a function for the first argument, .reply does not accept other arguments.'
|
||||
'Invalid arguments. When providing a function for the first argument, .reply does not accept other arguments.',
|
||||
)
|
||||
}
|
||||
this.statusCode = null
|
||||
|
|
@ -152,7 +152,7 @@ module.exports = class Interceptor {
|
|||
// Including all the default headers is safe for our purposes because of the specific headers we introspect.
|
||||
// A more thoughtful process is used to merge the default headers when the response headers are finally computed.
|
||||
this.headers = common.headersArrayToObject(
|
||||
this.rawHeaders.concat(this.scope._defaultReplyHeaders)
|
||||
this.rawHeaders.concat(this.scope._defaultReplyHeaders),
|
||||
)
|
||||
|
||||
// If the content is not encoded we may need to transform the response body.
|
||||
|
|
@ -236,7 +236,7 @@ module.exports = class Interceptor {
|
|||
"request header field doesn't match:",
|
||||
key,
|
||||
header,
|
||||
reqHeader
|
||||
reqHeader,
|
||||
)
|
||||
return false
|
||||
}
|
||||
|
|
@ -247,7 +247,7 @@ module.exports = class Interceptor {
|
|||
this.scope.logger(
|
||||
'attempting match %s, body = %s',
|
||||
stringify(options),
|
||||
stringify(body)
|
||||
stringify(body),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -259,7 +259,7 @@ module.exports = class Interceptor {
|
|||
|
||||
if (this.method !== method) {
|
||||
this.scope.logger(
|
||||
`Method did not match. Request ${method} Interceptor ${this.method}`
|
||||
`Method did not match. Request ${method} Interceptor ${this.method}`,
|
||||
)
|
||||
return false
|
||||
}
|
||||
|
|
@ -286,7 +286,7 @@ module.exports = class Interceptor {
|
|||
}
|
||||
|
||||
const reqHeadersMatch = Object.keys(this.reqheaders).every(key =>
|
||||
this.reqheaderMatches(options, key)
|
||||
this.reqheaderMatches(options, key),
|
||||
)
|
||||
|
||||
if (!reqHeadersMatch) {
|
||||
|
|
@ -299,13 +299,13 @@ module.exports = class Interceptor {
|
|||
!this.scope.scopeOptions.conditionally()
|
||||
) {
|
||||
this.scope.logger(
|
||||
'matching failed because Scope.conditionally() did not validate'
|
||||
'matching failed because Scope.conditionally() did not validate',
|
||||
)
|
||||
return false
|
||||
}
|
||||
|
||||
const badHeaders = this.badheaders.filter(
|
||||
header => header in options.headers
|
||||
header => header in options.headers,
|
||||
)
|
||||
|
||||
if (badHeaders.length) {
|
||||
|
|
@ -322,7 +322,7 @@ module.exports = class Interceptor {
|
|||
const matchQueries = this.matchQuery({ search })
|
||||
|
||||
this.scope.logger(
|
||||
matchQueries ? 'query matching succeeded' : 'query matching failed'
|
||||
matchQueries ? 'query matching succeeded' : 'query matching failed',
|
||||
)
|
||||
|
||||
if (!matchQueries) {
|
||||
|
|
@ -369,7 +369,7 @@ module.exports = class Interceptor {
|
|||
"bodies don't match: \n",
|
||||
this._requestBody,
|
||||
'\n',
|
||||
body
|
||||
body,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
node_modules/nock/lib/playback_interceptor.js
generated
vendored
4
node_modules/nock/lib/playback_interceptor.js
generated
vendored
|
|
@ -29,7 +29,7 @@ function parseFullReplyResult(response, fullReplyResult) {
|
|||
|
||||
if (fullReplyResult.length > 3) {
|
||||
throw Error(
|
||||
'The array returned from the .reply callback contains too many values'
|
||||
'The array returned from the .reply callback contains too many values',
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -257,7 +257,7 @@ function playbackInterceptor({
|
|||
}
|
||||
|
||||
response.rawHeaders.push(
|
||||
...selectDefaultHeaders(response.rawHeaders, defaultHeaders)
|
||||
...selectDefaultHeaders(response.rawHeaders, defaultHeaders),
|
||||
)
|
||||
|
||||
// Evaluate functional headers.
|
||||
|
|
|
|||
6
node_modules/nock/lib/recorder.js
generated
vendored
6
node_modules/nock/lib/recorder.js
generated
vendored
|
|
@ -68,7 +68,7 @@ function generateRequestAndResponseObject({
|
|||
}) {
|
||||
const { body, isUtf8Representable } = getBodyFromChunks(
|
||||
dataChunks,
|
||||
res.headers
|
||||
res.headers,
|
||||
)
|
||||
options.path = req.path
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ function generateRequestAndResponse({
|
|||
const formattedPair = common.formatQueryValue(
|
||||
key,
|
||||
queryObj[key],
|
||||
common.percentEncode
|
||||
common.percentEncode,
|
||||
)
|
||||
encodedQueryObj[formattedPair[0]] = formattedPair[1]
|
||||
}
|
||||
|
|
@ -368,7 +368,7 @@ function record(recOptions) {
|
|||
function restore() {
|
||||
debug(
|
||||
currentRecordingId,
|
||||
'restoring all the overridden http/https properties'
|
||||
'restoring all the overridden http/https properties',
|
||||
)
|
||||
|
||||
common.restoreOverriddenRequests()
|
||||
|
|
|
|||
18
node_modules/nock/lib/scope.js
generated
vendored
18
node_modules/nock/lib/scope.js
generated
vendored
|
|
@ -35,7 +35,7 @@ function normalizeUrl(u) {
|
|||
|
||||
if (!/https?:/.test(u.protocol)) {
|
||||
throw new TypeError(
|
||||
`Protocol '${u.protocol}' not recognized. This commonly occurs when a hostname and port are included without a protocol, producing a URL that is valid but confusing, and probably not what you want.`
|
||||
`Protocol '${u.protocol}' not recognized. This commonly occurs when a hostname and port are included without a protocol, producing a URL that is valid but confusing, and probably not what you want.`,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ class Scope extends EventEmitter {
|
|||
interceptor,
|
||||
this,
|
||||
this.scopeOptions,
|
||||
this.urlParts.hostname
|
||||
this.urlParts.hostname,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ class Scope extends EventEmitter {
|
|||
uri,
|
||||
method,
|
||||
requestBody,
|
||||
interceptorOptions
|
||||
interceptorOptions,
|
||||
)
|
||||
|
||||
this.interceptors.push(ic)
|
||||
|
|
@ -182,7 +182,7 @@ class Scope extends EventEmitter {
|
|||
this.keyedInterceptors[key].some(({ interceptionCounter, optional }) => {
|
||||
const persistedAndUsed = this._persist && interceptionCounter > 0
|
||||
return !persistedAndUsed && !optional
|
||||
})
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ class Scope extends EventEmitter {
|
|||
done() {
|
||||
assert.ok(
|
||||
this.isDone(),
|
||||
`Mocks not yet satisfied:\n${this.pendingMocks().join('\n')}`
|
||||
`Mocks not yet satisfied:\n${this.pendingMocks().join('\n')}`,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ class Scope extends EventEmitter {
|
|||
// However the code used to contain a truthiness test of `candidate`.
|
||||
// The check is being preserved for now.
|
||||
throw Error(
|
||||
`Nock internal assertion failed: typeof candidate is ${typeof candidate}. If you encounter this error, please report it as a bug.`
|
||||
`Nock internal assertion failed: typeof candidate is ${typeof candidate}. If you encounter this error, please report it as a bug.`,
|
||||
)
|
||||
}
|
||||
return candidate.replace(filteringArguments[0], filteringArguments[1])
|
||||
|
|
@ -234,7 +234,7 @@ class Scope extends EventEmitter {
|
|||
this.transformPathFunction = this.buildFilter.apply(this, arguments)
|
||||
if (!this.transformPathFunction) {
|
||||
throw new Error(
|
||||
'Invalid arguments: filtering path should be a function or a regular expression'
|
||||
'Invalid arguments: filtering path should be a function or a regular expression',
|
||||
)
|
||||
}
|
||||
return this
|
||||
|
|
@ -244,7 +244,7 @@ class Scope extends EventEmitter {
|
|||
this.transformRequestBodyFunction = this.buildFilter.apply(this, arguments)
|
||||
if (!this.transformRequestBodyFunction) {
|
||||
throw new Error(
|
||||
'Invalid arguments: filtering request body should be a function or a regular expression'
|
||||
'Invalid arguments: filtering request body should be a function or a regular expression',
|
||||
)
|
||||
}
|
||||
return this
|
||||
|
|
@ -326,7 +326,7 @@ function getScopeFromDefinition(nockDef) {
|
|||
} else {
|
||||
if (parseInt(options.port) !== parseInt(nockDef.port)) {
|
||||
throw new Error(
|
||||
'Mismatched port numbers in scope and port properties of nock definition.'
|
||||
'Mismatched port numbers in scope and port properties of nock definition.',
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
node_modules/nock/lib/socket.js
generated
vendored
2
node_modules/nock/lib/socket.js
generated
vendored
|
|
@ -74,7 +74,7 @@ module.exports = class Socket extends EventEmitter {
|
|||
|
||||
getPeerCertificate() {
|
||||
return Buffer.from(
|
||||
(Math.random() * 10000 + Date.now()).toString()
|
||||
(Math.random() * 10000 + Date.now()).toString(),
|
||||
).toString('base64')
|
||||
}
|
||||
|
||||
|
|
|
|||
6
node_modules/nock/package.json
generated
vendored
6
node_modules/nock/package.json
generated
vendored
|
|
@ -7,7 +7,7 @@
|
|||
"testing",
|
||||
"isolation"
|
||||
],
|
||||
"version": "13.3.3",
|
||||
"version": "13.3.4",
|
||||
"author": "Pedro Teixeira <pedro.teixeira@gmail.com>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
"chai": "^4.1.2",
|
||||
"dirty-chai": "^2.0.1",
|
||||
"eslint": "^8.8.0",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-config-standard": "^17.0.0-0",
|
||||
"eslint-plugin-import": "^2.16.0",
|
||||
"eslint-plugin-mocha": "^10.0.3",
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
"mocha": "^9.1.3",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"nyc": "^15.0.0",
|
||||
"prettier": "2.8.8",
|
||||
"prettier": "3.0.3",
|
||||
"proxyquire": "^2.1.0",
|
||||
"rimraf": "^3.0.0",
|
||||
"semantic-release": "^21.0.2",
|
||||
|
|
|
|||
44
node_modules/nock/types/index.d.ts
generated
vendored
44
node_modules/nock/types/index.d.ts
generated
vendored
|
|
@ -8,8 +8,8 @@ import { Url, URLSearchParams } from 'url'
|
|||
export = nock
|
||||
|
||||
declare function nock(
|
||||
basePath: string | RegExp | Url,
|
||||
options?: nock.Options
|
||||
basePath: string | RegExp | Url | URL,
|
||||
options?: nock.Options,
|
||||
): nock.Scope
|
||||
|
||||
declare namespace nock {
|
||||
|
|
@ -22,7 +22,7 @@ declare namespace nock {
|
|||
function removeInterceptor(interceptor: Interceptor | ReqOptions): boolean
|
||||
function disableNetConnect(): void
|
||||
function enableNetConnect(
|
||||
matcher?: string | RegExp | ((host: string) => boolean)
|
||||
matcher?: string | RegExp | ((host: string) => boolean),
|
||||
): void
|
||||
function load(path: string): Scope[]
|
||||
function loadDefs(path: string): Definition[]
|
||||
|
|
@ -37,7 +37,7 @@ declare namespace nock {
|
|||
type InterceptFunction = (
|
||||
uri: string | RegExp | { (uri: string): boolean },
|
||||
requestBody?: RequestBodyMatcher,
|
||||
interceptorOptions?: Options
|
||||
interceptorOptions?: Options,
|
||||
) => Interceptor
|
||||
|
||||
// Essentially valid, decoded JSON with the addition of possible RegExp. TS doesn't currently have
|
||||
|
|
@ -76,7 +76,7 @@ declare namespace nock {
|
|||
type ReplyHeaderFunction = (
|
||||
req: ClientRequest,
|
||||
res: IncomingMessage,
|
||||
body: string | Buffer
|
||||
body: string | Buffer,
|
||||
) => string | string[]
|
||||
type ReplyHeaderValue = string | string[] | ReplyHeaderFunction
|
||||
type ReplyHeaders =
|
||||
|
|
@ -110,7 +110,7 @@ declare namespace nock {
|
|||
uri: string | RegExp | { (uri: string): boolean },
|
||||
method: string,
|
||||
requestBody?: RequestBodyMatcher,
|
||||
options?: Options
|
||||
options?: Options,
|
||||
) => Interceptor
|
||||
|
||||
defaultReplyHeaders(headers: ReplyHeaders): this
|
||||
|
|
@ -137,7 +137,7 @@ declare namespace nock {
|
|||
| string
|
||||
| DataMatcherMap
|
||||
| URLSearchParams
|
||||
| { (parsedObj: ParsedUrlQuery): boolean }
|
||||
| { (parsedObj: ParsedUrlQuery): boolean },
|
||||
): this
|
||||
|
||||
// tslint (as of 5.16) is under the impression that the callback types can be unified,
|
||||
|
|
@ -151,16 +151,16 @@ declare namespace nock {
|
|||
body: Body,
|
||||
callback: (
|
||||
err: NodeJS.ErrnoException | null,
|
||||
result: ReplyFnResult
|
||||
) => void
|
||||
) => void
|
||||
result: ReplyFnResult,
|
||||
) => void,
|
||||
) => void,
|
||||
): Scope
|
||||
reply(
|
||||
replyFn: (
|
||||
this: ReplyFnContext,
|
||||
uri: string,
|
||||
body: Body
|
||||
) => ReplyFnResult | Promise<ReplyFnResult>
|
||||
body: Body,
|
||||
) => ReplyFnResult | Promise<ReplyFnResult>,
|
||||
): Scope
|
||||
reply(
|
||||
statusCode: StatusCode,
|
||||
|
|
@ -168,18 +168,21 @@ declare namespace nock {
|
|||
this: ReplyFnContext,
|
||||
uri: string,
|
||||
body: Body,
|
||||
callback: (err: NodeJS.ErrnoException | null, result: ReplyBody) => void
|
||||
callback: (
|
||||
err: NodeJS.ErrnoException | null,
|
||||
result: ReplyBody,
|
||||
) => void,
|
||||
) => void,
|
||||
headers?: ReplyHeaders
|
||||
headers?: ReplyHeaders,
|
||||
): Scope
|
||||
reply(
|
||||
statusCode: StatusCode,
|
||||
replyBodyFn: (
|
||||
this: ReplyFnContext,
|
||||
uri: string,
|
||||
body: Body
|
||||
body: Body,
|
||||
) => ReplyBody | Promise<ReplyBody>,
|
||||
headers?: ReplyHeaders
|
||||
headers?: ReplyHeaders,
|
||||
): Scope
|
||||
reply(responseCode?: StatusCode, body?: Body, headers?: ReplyHeaders): Scope
|
||||
/* tslint:enable:unified-signatures */
|
||||
|
|
@ -188,7 +191,7 @@ declare namespace nock {
|
|||
replyWithFile(
|
||||
statusCode: StatusCode,
|
||||
fileName: string,
|
||||
headers?: ReplyHeaders
|
||||
headers?: ReplyHeaders,
|
||||
): Scope
|
||||
|
||||
matchHeader(name: string, value: RequestHeaderMatcher): this
|
||||
|
|
@ -251,9 +254,12 @@ declare namespace nock {
|
|||
(
|
||||
fixtureName: string,
|
||||
options: BackOptions,
|
||||
nockedFn: (nockDone: () => void) => void
|
||||
nockedFn: (nockDone: () => void) => void,
|
||||
): void
|
||||
(fixtureName: string, options?: BackOptions): Promise<{
|
||||
(
|
||||
fixtureName: string,
|
||||
options?: BackOptions,
|
||||
): Promise<{
|
||||
nockDone: () => void
|
||||
context: BackContext
|
||||
}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue