1- // Copyright 2014- 2016, Google, Inc.
1+ // Copyright 2016 Google LLC
22// Licensed under the Apache License, Version 2.0 (the "License");
33// you may not use this file except in compliance with the License.
44// You may obtain a copy of the License at
@@ -140,7 +140,8 @@ describe('Query params', () => {
140140 } ) ;
141141
142142 it ( 'should be set if params passed are falsy' , async ( ) => {
143- nock ( Utils . baseUrl )
143+ const computeRemoteUrl = 'https://compute.googleapis.com' ;
144+ const r1 = nock ( Utils . baseUrl )
144145 . post (
145146 '/compute/v1/projects//zones//instances//setDiskAutoDelete?autoDelete=false&deviceName='
146147 )
@@ -153,7 +154,7 @@ describe('Query params', () => {
153154 deviceName : '' ,
154155 } ) ;
155156 assert . strictEqual ( Utils . getQs ( res ) , 'autoDelete=false&deviceName=' ) ;
156- nock ( Utils . baseUrl )
157+ const r2 = nock ( computeRemoteUrl )
157158 . post (
158159 '/compute/v1/projects//zones//instances//setDiskAutoDelete?autoDelete=false&deviceName='
159160 )
@@ -167,7 +168,7 @@ describe('Query params', () => {
167168 } ) ;
168169 assert . strictEqual ( Utils . getQs ( res2 ) , 'autoDelete=false&deviceName=' ) ;
169170
170- nock ( Utils . baseUrl )
171+ const r3 = nock ( Utils . baseUrl )
171172 . post ( '/compute/v1/projects//zones//instanceGroupManagers//resize?size=0' )
172173 . reply ( 200 ) ;
173174 const res3 = await localCompute . instanceGroupManagers . resize ( {
@@ -178,7 +179,7 @@ describe('Query params', () => {
178179 } ) ;
179180 assert . strictEqual ( Utils . getQs ( res3 ) , 'size=0' ) ;
180181
181- nock ( Utils . baseUrl )
182+ const r4 = nock ( computeRemoteUrl )
182183 . post ( '/compute/v1/projects//zones//instanceGroupManagers//resize?size=0' )
183184 . reply ( 200 ) ;
184185 const res4 = await remoteCompute . instanceGroupManagers . resize ( {
@@ -187,6 +188,10 @@ describe('Query params', () => {
187188 instanceGroupManager : '' ,
188189 size : 0 ,
189190 } ) ;
191+ r1 . done ( ) ;
192+ r2 . done ( ) ;
193+ r3 . done ( ) ;
194+ r4 . done ( ) ;
190195 assert . strictEqual ( Utils . getQs ( res4 ) , 'size=0' ) ;
191196 } ) ;
192197
0 commit comments