Skip to content

Commit

Permalink
fix(deps): fix nock version (#1812)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Sep 5, 2019
1 parent 2c7dde8 commit a9a7329
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -53,7 +53,6 @@
"@types/mocha": "^5.2.6",
"@types/mv": "^2.1.0",
"@types/ncp": "^2.0.1",
"@types/nock": "^10.0.2",
"@types/node": "^12.0.1",
"@types/nunjucks": "^3.1.1",
"@types/qs": "^6.5.3",
Expand All @@ -80,7 +79,7 @@
"mocha": "^6.1.4",
"mv": "^2.1.1",
"ncp": "^2.0.0",
"nock": "^11.0.0",
"nock": "^11.3.2",
"nunjucks": "^3.2.0",
"open": "^6.3.0",
"p-queue": "^6.0.0",
Expand Down
15 changes: 10 additions & 5 deletions test/test.query.ts
@@ -1,4 +1,4 @@
// Copyright 2014-2016, Google, Inc.
// Copyright 2016 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Expand Down Expand Up @@ -140,7 +140,8 @@ describe('Query params', () => {
});

it('should be set if params passed are falsy', async () => {
nock(Utils.baseUrl)
const computeRemoteUrl = 'https://compute.googleapis.com';
const r1 = nock(Utils.baseUrl)
.post(
'/compute/v1/projects//zones//instances//setDiskAutoDelete?autoDelete=false&deviceName='
)
Expand All @@ -153,7 +154,7 @@ describe('Query params', () => {
deviceName: '',
});
assert.strictEqual(Utils.getQs(res), 'autoDelete=false&deviceName=');
nock(Utils.baseUrl)
const r2 = nock(computeRemoteUrl)
.post(
'/compute/v1/projects//zones//instances//setDiskAutoDelete?autoDelete=false&deviceName='
)
Expand All @@ -167,7 +168,7 @@ describe('Query params', () => {
});
assert.strictEqual(Utils.getQs(res2), 'autoDelete=false&deviceName=');

nock(Utils.baseUrl)
const r3 = nock(Utils.baseUrl)
.post('/compute/v1/projects//zones//instanceGroupManagers//resize?size=0')
.reply(200);
const res3 = await localCompute.instanceGroupManagers.resize({
Expand All @@ -178,7 +179,7 @@ describe('Query params', () => {
});
assert.strictEqual(Utils.getQs(res3), 'size=0');

nock(Utils.baseUrl)
const r4 = nock(computeRemoteUrl)
.post('/compute/v1/projects//zones//instanceGroupManagers//resize?size=0')
.reply(200);
const res4 = await remoteCompute.instanceGroupManagers.resize({
Expand All @@ -187,6 +188,10 @@ describe('Query params', () => {
instanceGroupManager: '',
size: 0,
});
r1.done();
r2.done();
r3.done();
r4.done();
assert.strictEqual(Utils.getQs(res4), 'size=0');
});

Expand Down

0 comments on commit a9a7329

Please sign in to comment.