@@ -28,18 +28,18 @@ const CLUSTER_WORKERS = 3;
2828// TODO: Determine if this path should contain 'build'
2929const FILENAME = 'build/test/fixtures/fib.js' ;
3030
31- const delay = function ( delayTimeMS ) {
31+ const delay = function ( delayTimeMS : number ) : Promise < void > {
3232 return new Promise ( function ( resolve , reject ) {
3333 setTimeout ( resolve , delayTimeMS ) ;
3434 } ) ;
3535} ;
3636
3737// This test could take up to 70 seconds.
3838describe ( '@google-cloud/debug end-to-end behavior' , function ( ) {
39- let api ;
39+ let api : Debugger ;
4040
41- let debuggeeId ;
42- let projectId ;
41+ let debuggeeId : string ;
42+ let projectId : string ;
4343 let children = [ ] ;
4444
4545 before ( function ( ) {
@@ -133,7 +133,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
133133 it ( 'should set breakpoints correctly' , function ( ) {
134134 this . timeout ( 90 * 1000 ) ;
135135 // Kick off promise chain by getting a list of debuggees
136- return api . listDebuggees ( projectId ) . then ( function ( results ) {
136+ // TODO: Determine how to properly specify the signature of listDebuggees
137+ return ( api as any ) . listDebuggees ( projectId ) . then ( function ( results ) {
137138 // Check that the debuggee created in this test is among the list of
138139 // debuggees, then list its breakpoints
139140
@@ -147,7 +148,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
147148 return d . id === debuggeeId ;
148149 } ) ;
149150 assert . ok ( result , 'should find the debuggee we just registered' ) ;
150- return api . listBreakpoints ( debuggeeId ) ;
151+ // TODO: Determine how to properly specify the signature of listDebuggees
152+ return ( api as any ) . listBreakpoints ( debuggeeId ) ;
151153 } ) . then ( function ( results ) {
152154 // Delete every breakpoint
153155
@@ -156,7 +158,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
156158 console . log ( '-- List of breakpoints\n' , breakpoints ) ;
157159
158160 const promises = breakpoints . map ( function ( breakpoint ) {
159- return api . deleteBreakpoint ( debuggeeId , breakpoint . id ) ;
161+ // TODO: Determine how to properly specify the signature of listDebuggees
162+ return ( api as any ) . deleteBreakpoint ( debuggeeId , breakpoint . id ) ;
160163 } ) ;
161164
162165 return Promise . all ( promises ) ;
@@ -169,7 +172,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
169172 console . log ( '-- deleted' ) ;
170173
171174 console . log ( '-- setting a logpoint' ) ;
172- return api . setBreakpoint ( debuggeeId , {
175+ // TODO: Determine how to properly specify the signature of listDebuggees
176+ return ( api as any ) . setBreakpoint ( debuggeeId , {
173177 id : 'breakpoint-1' ,
174178 location : { path : FILENAME , line : 5 } ,
175179 condition : 'n === 10' ,
@@ -205,7 +209,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
205209 // Set another breakpoint at the same location
206210
207211 console . log ( '-- setting a breakpoint' ) ;
208- return api . setBreakpoint ( debuggeeId , {
212+ // TODO: Determine how to properly specify the signature of listDebuggees
213+ return ( api as any ) . setBreakpoint ( debuggeeId , {
209214 id : 'breakpoint-2' ,
210215 location : { path : FILENAME , line : 5 } ,
211216 expressions : [ 'process' ] , // Process for large variable
@@ -231,7 +236,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
231236 const breakpoint = results [ 0 ] ;
232237
233238 console . log ( '-- now checking if the breakpoint was hit' ) ;
234- return api . getBreakpoint ( debuggeeId , breakpoint . id ) ;
239+ // TODO: Determine how to properly specify the signature of listDebuggees
240+ return ( api as any ) . getBreakpoint ( debuggeeId , breakpoint . id ) ;
235241 } ) . then ( function ( results ) {
236242 // Check that the breakpoint was hit and contains the correct information,
237243 // which ends the test
@@ -262,7 +268,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
262268 assert . ok ( count > 4 ) ;
263269 } ) ;
264270
265- return api . deleteBreakpoint ( debuggeeId , breakpoint . id ) ;
271+ // TODO: Determine how to properly specify the signature of listDebuggees
272+ return ( api as any ) . deleteBreakpoint ( debuggeeId , breakpoint . id ) ;
266273 } ) . then ( function ( ) {
267274 // wait for 60 seconds
268275 console . log ( '-- waiting for 60 seconds' ) ;
@@ -283,7 +290,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
283290 it ( 'should throttle logs correctly' , function ( ) {
284291 this . timeout ( 15 * 1000 ) ;
285292 // Kick off promise chain by getting a list of debuggees
286- return api . listDebuggees ( projectId ) . then ( function ( results ) {
293+ // TODO: Determine how to properly specify the signature of listDebuggees
294+ return ( api as any ) . listDebuggees ( projectId ) . then ( function ( results ) {
287295 // Check that the debuggee created in this test is among the list of
288296 // debuggees, then list its breakpoints
289297
@@ -298,7 +306,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
298306 } ) ;
299307 assert . ok ( result , 'should find the debuggee we just registered' ) ;
300308
301- return api . listBreakpoints ( debuggeeId ) ;
309+ // TODO: Determine how to properly specify the signature of listDebuggees
310+ return ( api as any ) . listBreakpoints ( debuggeeId ) ;
302311 } ) . then ( function ( results ) {
303312 // Delete every breakpoint
304313
@@ -307,7 +316,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
307316 console . log ( '-- List of breakpoints\n' , breakpoints ) ;
308317
309318 const promises = breakpoints . map ( function ( breakpoint ) {
310- return api . deleteBreakpoint ( debuggeeId , breakpoint . id ) ;
319+ // TODO: Determine how to properly specify the signature of listDebuggees
320+ return ( api as any ) . deleteBreakpoint ( debuggeeId , breakpoint . id ) ;
311321 } ) ;
312322
313323 return Promise . all ( promises ) ;
@@ -320,7 +330,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
320330 console . log ( '-- deleted' ) ;
321331
322332 console . log ( '-- setting a logpoint' ) ;
323- return api . setBreakpoint ( debuggeeId , {
333+ // TODO: Determine how to properly specify the signature of listDebuggees
334+ return ( api as any ) . setBreakpoint ( debuggeeId , {
324335 id : 'breakpoint-3' ,
325336 location : { path : FILENAME , line : 5 } ,
326337 condition : 'n === 10' ,
@@ -358,7 +369,8 @@ describe('@google-cloud/debug end-to-end behavior', function () {
358369 assert ( logCount > 2 , 'log count is not greater than 2: ' + logCount ) ;
359370 } ) ;
360371
361- return api . deleteBreakpoint ( debuggeeId , breakpoint . id ) ;
372+ // TODO: Determine how to properly specify the signature of listDebuggees
373+ return ( api as any ) . deleteBreakpoint ( debuggeeId , breakpoint . id ) ;
362374 } ) . then ( function ( ) {
363375 console . log ( '-- test passed' ) ;
364376 return Promise . resolve ( ) ;
0 commit comments