1616
1717'use strict' ;
1818
19- var assert = require ( 'assert' ) ;
19+ import * as assert from 'assert' ;
2020
2121assert . ok (
2222 process . env . GCLOUD_PROJECT ,
@@ -26,9 +26,12 @@ assert.ok(
2626 'Need to have GOOGLE_APPLICATION_CREDENTIALS defined to be able to run ' +
2727 'this test' ) ;
2828
29- var Controller = require ( '../src/controller.js' ) . Controller ;
30- var Debuggee = require ( '../src/debuggee.js' ) . Debuggee ;
31- var debug = require ( '../src/debug.js' ) . Debug ( ) ;
29+ import { Controller } from '../src/controller' ;
30+ import { Debuggee } from '../src/debuggee' ;
31+ import { Debug } from '../src/debug' ;
32+ // TODO: Determine if Debug should be updated so that its only parameter is
33+ // optional.
34+ const debug = new Debug ( { } ) ;
3235
3336
3437describe ( 'Controller' , function ( ) {
@@ -40,11 +43,14 @@ describe('Controller', function() {
4043 new Debuggee ( {
4144 project : process . env . GCLOUD_PROJECT ,
4245 uniquifier : 'test-uid-' + Date . now ( ) ,
43- description : 'this is a system test'
46+ description : 'this is a system test' ,
47+ // TODO: Determine if statusMessage should be made optional.
48+ statusMessage : null
4449 } ) ;
4550
4651 controller . register ( debuggee , function ( err , body ) {
47- assert . ifError ( err , 'should be able to register successfully' ) ;
52+ // TODO: Only 1 parameter is expected. Fix this.
53+ ( assert as any ) . ifError ( err , 'should be able to register successfully' ) ;
4854 assert . ok ( body ) ;
4955 assert . ok ( body . debuggee ) ;
5056 assert . ok ( body . debuggee . id ) ;
@@ -56,15 +62,19 @@ describe('Controller', function() {
5662 var controller = new Controller ( debug ) ;
5763 var debuggee =
5864 new Debuggee ( {
59- project : process . env . GCLOUD_PROJECT ,
65+ project : process . env . GCLOUD_PROJECT ,
6066 uniquifier : 'test-uid-' + Date . now ( ) ,
61- description : 'this is a system test'
67+ description : 'this is a system test' ,
68+ // TODO: Determine if statusMessage should be made optional.
69+ statusMessage : null
6270 } ) ;
6371 controller . register ( debuggee , function ( err , body ) {
64- assert . ifError ( err , 'should be able to register successfully' ) ;
72+ // TODO: Only 1 parameter is expected. Fix this.
73+ ( assert as any ) . ifError ( err , 'should be able to register successfully' ) ;
6574
6675 controller . listBreakpoints ( debuggee , function ( err , response , body ) {
67- assert . ifError ( err , 'should successfully list breakpoints' ) ;
76+ // TODO: Only 1 parameter is expected. Fix this.
77+ ( assert as any ) . ifError ( err , 'should successfully list breakpoints' ) ;
6878 assert . ok ( body ) ;
6979 assert . ok ( body . nextWaitToken ) ;
7080 done ( ) ;
@@ -79,19 +89,24 @@ describe('Controller', function() {
7989 new Debuggee ( {
8090 project : process . env . GCLOUD_PROJECT ,
8191 uniquifier : 'test-uid-' + Date . now ( ) ,
82- description : 'this is a system test'
92+ description : 'this is a system test' ,
93+ // TODO: Determine if statusMessage should be made optional.
94+ statusMessage : null
8395 } ) ;
8496 controller . register ( debuggee , function ( err , body ) {
85- assert . ifError ( err , 'should be able to register successfully' ) ;
97+ // TODO: Only 1 parameter is expected. Fix this.
98+ ( assert as any ) . ifError ( err , 'should be able to register successfully' ) ;
8699
87100 // First list should set the wait token
88101 controller . listBreakpoints ( debuggee , function ( err , response , body ) {
89- assert . ifError ( err , 'should successfully list breakpoints' ) ;
102+ // TODO: Only 1 parameter is expected. Fix this.
103+ ( assert as any ) . ifError ( err , 'should successfully list breakpoints' ) ;
90104 assert . ok ( body ) ;
91105 assert . ok ( body . nextWaitToken ) ;
92106 // Second list should block until the wait timeout
93107 controller . listBreakpoints ( debuggee , function ( err , response , body ) {
94- assert . ifError ( err , 'should successfully list breakpoints' ) ;
108+ // TODO: Only 1 parameter is expected. Fix this.
109+ ( assert as any ) . ifError ( err , 'should successfully list breakpoints' ) ;
95110 assert . ok ( body ) ;
96111 assert . ok ( body . nextWaitToken ) ;
97112 // waitExpired will only be set if successOnTimeout was given correctly
0 commit comments