@@ -1169,8 +1169,7 @@ describe('Debuglet', () => {
11691169 debuglet . start ( ) ;
11701170 } ) ;
11711171
1172- /*it('should have breakpoints fetched when promise is resolved', function (done) {
1173- // FIXME: Broken.
1172+ it ( 'should have breakpoints fetched when promise is resolved' , function ( done ) {
11741173 this . timeout ( 2000 ) ;
11751174 const breakpoint : stackdriver . Breakpoint = {
11761175 id : 'test1' ,
@@ -1189,7 +1188,6 @@ describe('Debuglet', () => {
11891188 . post ( REGISTER_PATH )
11901189 . reply ( 200 , { debuggee : { id : DEBUGGEE_ID } } )
11911190 . get ( BPS_PATH + '?successOnTimeout=true' )
1192- .twice()
11931191 . reply ( 200 , { breakpoints : [ breakpoint ] } ) ;
11941192 const debugPromise = debuglet . isReadyManager . isReady ( ) ;
11951193 debuglet . once ( 'registered' , ( ) => {
@@ -1212,7 +1210,6 @@ describe('Debuglet', () => {
12121210 } ) ;
12131211
12141212 it ( 'should resolve breakpointFetched promise when registration expires' , function ( done ) {
1215- // FIXME: Broken.
12161213 this . timeout ( 2000 ) ;
12171214 const debug = new Debug (
12181215 { projectId : 'fake-project' , credentials : fakeCredentials } ,
@@ -1237,7 +1234,7 @@ describe('Debuglet', () => {
12371234 } ) ;
12381235
12391236 debuglet . start ( ) ;
1240- });*/
1237+ } ) ;
12411238
12421239 it ( 'should reject breakpoints with conditions when allowExpressions=false' , function ( done ) {
12431240 this . timeout ( 2000 ) ;
@@ -1425,8 +1422,7 @@ describe('Debuglet', () => {
14251422 // The test expires a breakpoint and then has the api respond with
14261423 // the breakpoint listed as active. It validates that the breakpoint
14271424 // is only expired with the server once.
1428- /*it('should not update expired breakpoints', function (done) {
1429- // FIXME: Broken
1425+ it ( 'should not update expired breakpoints' , function ( done ) {
14301426 const debug = new Debug (
14311427 { projectId : 'fake-project' , credentials : fakeCredentials } ,
14321428 packageInfo
@@ -1440,6 +1436,7 @@ describe('Debuglet', () => {
14401436 forceNewAgent_ : true ,
14411437 } ) ;
14421438 const debuglet = new Debuglet ( debug , config ) ;
1439+ let unexpectedUpdate = false ;
14431440 const scope = nock ( config . apiUrl )
14441441 . post ( REGISTER_PATH )
14451442 . reply ( 200 , { debuggee : { id : DEBUGGEE_ID } } )
@@ -1459,15 +1456,20 @@ describe('Debuglet', () => {
14591456 . times ( 4 )
14601457 . reply ( 200 , { breakpoints : [ bp ] } ) ;
14611458
1459+ // Get ready to fail the test if any additional updates come through.
1460+ nock . emitter . on ( 'no match' , req => {
1461+ if ( req . path . startsWith ( BPS_PATH ) && req . method === 'PUT' ) {
1462+ unexpectedUpdate = true ;
1463+ }
1464+ } ) ;
1465+
14621466 debuglet . once ( 'registered' , ( id : string ) => {
14631467 assert . strictEqual ( id , DEBUGGEE_ID ) ;
14641468 setTimeout ( ( ) => {
14651469 assert . deepStrictEqual ( debuglet . activeBreakpointMap . test , bp ) ;
14661470 setTimeout ( ( ) => {
14671471 assert ( ! debuglet . activeBreakpointMap . test ) ;
1468- // Fetcher disables if we re-update since endpoint isn't mocked
1469- // twice
1470- assert(debuglet.fetcherActive);
1472+ assert ( ! unexpectedUpdate , 'unexpected update request' ) ;
14711473 debuglet . stop ( ) ;
14721474 scope . done ( ) ;
14731475 done ( ) ;
@@ -1476,7 +1478,7 @@ describe('Debuglet', () => {
14761478 } ) ;
14771479
14781480 debuglet . start ( ) ;
1479- });*/
1481+ } ) ;
14801482 } ) ;
14811483
14821484 describe ( 'map subtract' , ( ) => {
0 commit comments