@@ -560,6 +560,37 @@ describe('Master tests', function() {
560560 } ) ;
561561 } ) ;
562562
563+ it ( 'Verify checkin with custom health-check error that returns a raw string' , function ( done ) {
564+ var customHealthFuns = [
565+ function ( m , callback ) {
566+ return callback ( null ) ;
567+ } ,
568+ function ( m , callback ) {
569+ return callback ( "A Raw String Error" ) ;
570+ }
571+ ] ;
572+ var master = new AlAzureMaster ( mock . DEFAULT_FUNCTION_CONTEXT , 'ehub' , '1.0.0' , customHealthFuns ) ;
573+ master . checkin ( '2017-12-22T14:31:39' , function ( err ) {
574+ if ( err ) console . log ( err ) ;
575+ const expectedCheckin = {
576+ body : {
577+ version : '1.0.0' ,
578+ app_tenant_id : 'tenant-id' ,
579+ collection_stats : { 'log' : { 'bytes' : 10 , 'events' : 15 } } ,
580+ host_id : 'existing-host-id' ,
581+ source_id : 'existing-source-id' ,
582+ statistics : [ { 'Master' : { 'errors' : 0 , 'invocations' : 2 } } , { 'Collector' : { 'errors' : 1 , 'invocations' : 10 } } , { 'Updater' : { 'errors' : 0 , 'invocations' : 0 } } ] ,
583+ status : 'error' ,
584+ details : [ "A Raw String Error" ] ,
585+ error_code : 'ALAZU000004'
586+ }
587+ } ;
588+ const expectedUrl = '/azure/ehub/checkin/subscription-id/kktest11-rg/kktest11-name' ;
589+ sinon . assert . calledWithMatch ( fakePost , expectedUrl , expectedCheckin ) ;
590+ done ( ) ;
591+ } ) ;
592+ } ) ;
593+
563594 it ( 'Verify checkin with custom health-check error' , function ( done ) {
564595 var customHealthFuns = [
565596 function ( m , callback ) {
0 commit comments