Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 338ed3a

Browse files
renovate[bot]mayurkale22
authored andcommitted
Update dependency @types/nock to v10 (#553)
* Update dependency @types/nock to v10 * Fix build
1 parent 303c4ca commit 338ed3a

File tree

15 files changed

+34
-59
lines changed

15 files changed

+34
-59
lines changed

packages/opencensus-exporter-instana/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opencensus-exporter-instana/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"devDependencies": {
5353
"@types/mocha": "^5.2.5",
54-
"@types/nock": "^9.1.3",
54+
"@types/nock": "^10.0.0",
5555
"@types/node": "^10.12.12",
5656
"codecov": "^3.4.0",
5757
"gts": "^0.9.0",

packages/opencensus-exporter-jaeger/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opencensus-exporter-jaeger/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
},
5151
"devDependencies": {
5252
"@types/mocha": "^5.2.5",
53-
"@types/nock": "^9.1.3",
53+
"@types/nock": "^10.0.0",
5454
"@types/node": "^10.12.12",
5555
"codecov": "^3.4.0",
5656
"gts": "^0.9.0",

packages/opencensus-exporter-stackdriver/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opencensus-exporter-stackdriver/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
},
5353
"devDependencies": {
5454
"@types/mocha": "^5.2.5",
55-
"@types/nock": "^9.1.3",
55+
"@types/nock": "^10.0.0",
5656
"@types/node": "^10.12.12",
5757
"codecov": "^3.4.0",
5858
"gts": "^0.9.0",

packages/opencensus-exporter-stackdriver/test/nocks.ts

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -100,53 +100,28 @@ export function hostname(status: number|(() => string), reply?: () => string) {
100100
}
101101

102102
export function batchWrite<T extends {} = {}>(
103-
project: string, validator?: (body: T) => boolean, reply?: () => string,
104-
withError?: boolean) {
103+
project: string, validator?: (body: T) => boolean, reply?: () => string) {
105104
validator = validator || accept;
106105
const interceptor =
107106
nock('https://cloudtrace.googleapis.com')
108107
.post('/v2/projects/' + project + '/traces:batchWrite', validator);
109-
let scope: nock.Scope;
110-
if (withError) {
111-
scope = interceptor.replyWithError(reply);
112-
} else if (reply) {
113-
scope = interceptor.reply(reply);
114-
} else {
115-
scope = interceptor.reply(200);
116-
}
117-
return scope;
108+
return reply ? interceptor.reply(reply) : interceptor.reply(200);
118109
}
119110

120111
export function timeSeries<T extends {} = {}>(
121-
project: string, validator?: (body: T) => boolean, reply?: () => string,
122-
withError?: boolean) {
112+
project: string, validator?: (body: T) => boolean, reply?: () => string) {
123113
validator = validator || accept;
124114
const interceptor =
125115
nock('https://monitoring.googleapis.com')
126116
.post('/v3/projects/' + project + '/timeSeries', validator);
127-
let scope: nock.Scope;
128-
if (withError) {
129-
scope = interceptor.replyWithError(reply);
130-
} else if (reply) {
131-
scope = interceptor.reply(reply);
132-
} else {
133-
scope = interceptor.reply(200, reply);
134-
}
135-
return scope;
117+
return reply ? interceptor.reply(reply) : interceptor.reply(200);
136118
}
137119

138120
export function metricDescriptors<T extends {} = {}>(
139-
project: string, validator?: (body: T) => boolean, reply?: () => string,
140-
withError?: boolean) {
121+
project: string, validator?: (body: T) => boolean, reply?: () => string) {
141122
validator = validator || accept;
142123
const interceptor =
143124
nock('https://monitoring.googleapis.com')
144125
.post('/v3/projects/' + project + '/metricDescriptors', validator);
145-
let scope: nock.Scope;
146-
if (withError) {
147-
scope = interceptor.replyWithError(reply);
148-
} else {
149-
scope = interceptor.reply(200, reply);
150-
}
151-
return scope;
126+
return reply ? interceptor.reply(reply) : interceptor.reply(200);
152127
}

packages/opencensus-exporter-zipkin/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opencensus-exporter-zipkin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
},
5151
"devDependencies": {
5252
"@types/mocha": "^5.2.5",
53-
"@types/nock": "^9.1.3",
53+
"@types/nock": "^10.0.0",
5454
"@types/node": "^10.12.12",
5555
"codecov": "^3.4.0",
5656
"gts": "^0.9.0",

packages/opencensus-instrumentation-http/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)