@@ -66,7 +66,7 @@ describe('generate-report', () => {
6666 }
6767 ` )
6868 expect ( result . healthy ) . toBe ( true )
69- expect ( result . alerts . size ) . toBe ( 0 )
69+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 0 )
7070 } )
7171
7272 it ( 'should return a sick report with alert when an alert violates at error' , ( ) => {
@@ -130,7 +130,7 @@ describe('generate-report', () => {
130130 }
131131 ` )
132132 expect ( result . healthy ) . toBe ( false )
133- expect ( result . alerts . size ) . toBe ( 1 )
133+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 1 )
134134 } )
135135
136136 it ( 'should return a healthy report with alert when an alert violates at warn' , ( ) => {
@@ -194,7 +194,7 @@ describe('generate-report', () => {
194194 }
195195 ` )
196196 expect ( result . healthy ) . toBe ( true )
197- expect ( result . alerts . size ) . toBe ( 1 )
197+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 1 )
198198 } )
199199
200200 it ( 'should return a healthy report without alerts when an alert violates at monitor' , ( ) => {
@@ -233,7 +233,7 @@ describe('generate-report', () => {
233233 }
234234 ` )
235235 expect ( result . healthy ) . toBe ( true )
236- expect ( result . alerts . size ) . toBe ( 0 )
236+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 0 )
237237 } )
238238
239239 it ( 'should return a healthy report without alerts when an alert violates at ignore' , ( ) => {
@@ -272,7 +272,7 @@ describe('generate-report', () => {
272272 }
273273 ` )
274274 expect ( result . healthy ) . toBe ( true )
275- expect ( result . alerts . size ) . toBe ( 0 )
275+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 0 )
276276 } )
277277
278278 it ( 'should return a healthy report without alerts when an alert violates at defer' , ( ) => {
@@ -311,7 +311,7 @@ describe('generate-report', () => {
311311 }
312312 ` )
313313 expect ( result . healthy ) . toBe ( true )
314- expect ( result . alerts . size ) . toBe ( 0 )
314+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 0 )
315315 } )
316316
317317 it ( 'should return a healthy report without alerts when an alert has no policy value' , ( ) => {
@@ -348,7 +348,7 @@ describe('generate-report', () => {
348348 }
349349 ` )
350350 expect ( result . healthy ) . toBe ( true )
351- expect ( result . alerts . size ) . toBe ( 0 )
351+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 0 )
352352 } )
353353
354354 it ( 'should return a healthy report without alerts when an alert has no policy entry' , ( ) => {
@@ -383,7 +383,7 @@ describe('generate-report', () => {
383383 }
384384 ` )
385385 expect ( result . healthy ) . toBe ( true )
386- expect ( result . alerts . size ) . toBe ( 0 )
386+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 0 )
387387 } )
388388 } )
389389
@@ -424,7 +424,7 @@ describe('generate-report', () => {
424424 }
425425 ` )
426426 expect ( result . healthy ) . toBe ( true )
427- expect ( result . alerts . size ) . toBe ( 0 )
427+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 0 )
428428 } )
429429
430430 it ( 'should return a sick report with alert when an alert violates at error' , ( ) => {
@@ -488,7 +488,7 @@ describe('generate-report', () => {
488488 }
489489 ` )
490490 expect ( result . healthy ) . toBe ( false )
491- expect ( result . alerts . size ) . toBe ( 1 )
491+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 1 )
492492 } )
493493
494494 it ( 'should return a healthy report with alert when an alert violates at warn' , ( ) => {
@@ -552,7 +552,7 @@ describe('generate-report', () => {
552552 }
553553 ` )
554554 expect ( result . healthy ) . toBe ( true )
555- expect ( result . alerts . size ) . toBe ( 1 )
555+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 1 )
556556 } )
557557
558558 it ( 'should return a healthy report with alert when an alert violates at monitor' , ( ) => {
@@ -616,7 +616,7 @@ describe('generate-report', () => {
616616 }
617617 ` )
618618 expect ( result . healthy ) . toBe ( true )
619- expect ( result . alerts . size ) . toBe ( 1 )
619+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 1 )
620620 } )
621621
622622 it ( 'should return a healthy report with alert when an alert violates at ignore' , ( ) => {
@@ -680,7 +680,7 @@ describe('generate-report', () => {
680680 }
681681 ` )
682682 expect ( result . healthy ) . toBe ( true )
683- expect ( result . alerts . size ) . toBe ( 1 )
683+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 1 )
684684 } )
685685
686686 it ( 'should return a healthy report without alerts when an alert violates at defer' , ( ) => {
@@ -719,7 +719,7 @@ describe('generate-report', () => {
719719 }
720720 ` )
721721 expect ( result . healthy ) . toBe ( true )
722- expect ( result . alerts . size ) . toBe ( 0 )
722+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 0 )
723723 } )
724724
725725 it ( 'should return a healthy report without alerts when an alert has no policy value' , ( ) => {
@@ -756,7 +756,7 @@ describe('generate-report', () => {
756756 }
757757 ` )
758758 expect ( result . healthy ) . toBe ( true )
759- expect ( result . alerts . size ) . toBe ( 0 )
759+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 0 )
760760 } )
761761
762762 it ( 'should return a healthy report without alerts when an alert has no policy entry' , ( ) => {
@@ -791,7 +791,7 @@ describe('generate-report', () => {
791791 }
792792 ` )
793793 expect ( result . healthy ) . toBe ( true )
794- expect ( result . alerts . size ) . toBe ( 0 )
794+ expect ( result [ ' alerts' ] ? .size ) . toBe ( 0 )
795795 } )
796796 } )
797797 } )
0 commit comments