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

Commit c10ed58

Browse files
chore: update nock to v11 (#764)
1 parent a9dba8c commit c10ed58

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"@types/mkdirp": "^0.5.1",
7373
"@types/mocha": "^5.0.0",
7474
"@types/ncp": "^2.0.1",
75-
"@types/nock": "^10.0.0",
7675
"@types/node": "~10.14.0",
7776
"@types/proxyquire": "^1.3.28",
7877
"@types/semver": "^6.0.0",
@@ -86,7 +85,7 @@
8685
"mkdirp": "^0.5.1",
8786
"mocha": "^6.1.4",
8887
"ncp": "^2.0.0",
89-
"nock": "^10.0.0",
88+
"nock": "^11.0.0",
9089
"nyc": "^14.0.0",
9190
"post-install-check": "0.0.1",
9291
"proxyquire": "^2.0.0",

test/test-controller.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,17 @@ describe('Controller API', () => {
249249
id: 'breakpoint-0',
250250
location: {path: 'foo.js', line: 99},
251251
} as stackdriver.Breakpoint;
252+
// A cast for the second argument to put() is necessary for nock 11
253+
// because the type definitions state that the second argument cannot
254+
// be an Object even though the nock code itself seems to handle an
255+
// Object. Further, the tests pass when using the cast.
256+
// This issue is being tracked in the nock repo at
257+
// https://github.com/nock/nock/issues/1731.
252258
const scope = nock(url)
253259
.put(api + '/debuggees/fake-debuggee/breakpoints/breakpoint-0', {
254260
debuggeeId: 'fake-debuggee',
255261
breakpoint,
256-
})
262+
} as {})
257263
.reply(200, {
258264
kind: 'debugletcontroller#updateActiveBreakpointResponse',
259265
});

test/test-debuglet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function verifyBreakpointRejection(
7171
body: {breakpoint: stackdriver.Breakpoint}
7272
) {
7373
const status = body.breakpoint.status;
74-
const hasCorrectDescription = status!.description.format.match(re);
74+
const hasCorrectDescription = !!status!.description.format.match(re);
7575
return status!.isError && hasCorrectDescription;
7676
}
7777

0 commit comments

Comments
 (0)