@@ -59,7 +59,7 @@ export default ({ getService }: FtrProviderContext) => {
5959 await waitForRuleSuccessOrStatus ( supertest , id ) ;
6060 await waitForSignalsToBePresent ( supertest , 4 , [ id ] ) ;
6161 const signalsOpen = await getSignalsById ( supertest , id ) ;
62- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) . sort ( ) ;
62+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) . sort ( ) ;
6363 expect ( hits ) . to . eql ( [
6464 {
6565 os : { type : 'linux' } ,
@@ -82,7 +82,7 @@ export default ({ getService }: FtrProviderContext) => {
8282 await waitForRuleSuccessOrStatus ( supertest , id ) ;
8383 await waitForSignalsToBePresent ( supertest , 4 , [ id ] ) ;
8484 const signalsOpen = await getSignalsById ( supertest , id ) ;
85- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) . sort ( ) ;
85+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) . sort ( ) ;
8686 expect ( hits ) . to . eql ( [
8787 {
8888 os : { name : 'Linux' } ,
@@ -125,7 +125,7 @@ export default ({ getService }: FtrProviderContext) => {
125125 await waitForRuleSuccessOrStatus ( supertest , id ) ;
126126 await waitForSignalsToBePresent ( supertest , 3 , [ id ] ) ;
127127 const signalsOpen = await getSignalsById ( supertest , id ) ;
128- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
128+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
129129 expect ( hits ) . to . eql ( [
130130 {
131131 os : { name : 'Windows' } ,
@@ -162,7 +162,7 @@ export default ({ getService }: FtrProviderContext) => {
162162 await waitForRuleSuccessOrStatus ( supertest , id ) ;
163163 await waitForSignalsToBePresent ( supertest , 3 , [ id ] ) ;
164164 const signalsOpen = await getSignalsById ( supertest , id ) ;
165- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
165+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
166166 expect ( hits ) . to . eql ( [
167167 {
168168 os : { name : 'Windows' } ,
@@ -210,7 +210,7 @@ export default ({ getService }: FtrProviderContext) => {
210210 await waitForRuleSuccessOrStatus ( supertest , id ) ;
211211 await waitForSignalsToBePresent ( supertest , 2 , [ id ] ) ;
212212 const signalsOpen = await getSignalsById ( supertest , id ) ;
213- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
213+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
214214 expect ( hits ) . to . eql ( [
215215 {
216216 os : { name : 'Macos' } ,
@@ -255,7 +255,7 @@ export default ({ getService }: FtrProviderContext) => {
255255 await waitForRuleSuccessOrStatus ( supertest , id ) ;
256256 await waitForSignalsToBePresent ( supertest , 2 , [ id ] ) ;
257257 const signalsOpen = await getSignalsById ( supertest , id ) ;
258- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
258+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
259259 expect ( hits ) . to . eql ( [
260260 {
261261 os : { name : 'Macos' } ,
@@ -291,7 +291,7 @@ export default ({ getService }: FtrProviderContext) => {
291291 await waitForRuleSuccessOrStatus ( supertest , id ) ;
292292 await waitForSignalsToBePresent ( supertest , 3 , [ id ] ) ;
293293 const signalsOpen = await getSignalsById ( supertest , id ) ;
294- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
294+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
295295 expect ( hits ) . to . eql ( [
296296 {
297297 os : { type : 'windows' } ,
@@ -328,7 +328,7 @@ export default ({ getService }: FtrProviderContext) => {
328328 await waitForRuleSuccessOrStatus ( supertest , id ) ;
329329 await waitForSignalsToBePresent ( supertest , 3 , [ id ] ) ;
330330 const signalsOpen = await getSignalsById ( supertest , id ) ;
331- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
331+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
332332 expect ( hits ) . to . eql ( [
333333 {
334334 os : { type : 'windows' } ,
@@ -376,7 +376,7 @@ export default ({ getService }: FtrProviderContext) => {
376376 await waitForRuleSuccessOrStatus ( supertest , id ) ;
377377 await waitForSignalsToBePresent ( supertest , 2 , [ id ] ) ;
378378 const signalsOpen = await getSignalsById ( supertest , id ) ;
379- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
379+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
380380 expect ( hits ) . to . eql ( [
381381 {
382382 os : { type : 'macos' } ,
@@ -421,7 +421,7 @@ export default ({ getService }: FtrProviderContext) => {
421421 await waitForRuleSuccessOrStatus ( supertest , id ) ;
422422 await waitForSignalsToBePresent ( supertest , 2 , [ id ] ) ;
423423 const signalsOpen = await getSignalsById ( supertest , id ) ;
424- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
424+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
425425 expect ( hits ) . to . eql ( [
426426 {
427427 os : { type : 'macos' } ,
@@ -457,7 +457,7 @@ export default ({ getService }: FtrProviderContext) => {
457457 await waitForRuleSuccessOrStatus ( supertest , id ) ;
458458 await waitForSignalsToBePresent ( supertest , 6 , [ id ] ) ;
459459 const signalsOpen = await getSignalsById ( supertest , id ) ;
460- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
460+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
461461 expect ( hits ) . to . eql ( [
462462 {
463463 os : { type : 'windows' } ,
@@ -503,7 +503,7 @@ export default ({ getService }: FtrProviderContext) => {
503503 await waitForRuleSuccessOrStatus ( supertest , id ) ;
504504 await waitForSignalsToBePresent ( supertest , 6 , [ id ] ) ;
505505 const signalsOpen = await getSignalsById ( supertest , id ) ;
506- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
506+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
507507 expect ( hits ) . to . eql ( [
508508 {
509509 os : { type : 'windows' } ,
@@ -560,7 +560,7 @@ export default ({ getService }: FtrProviderContext) => {
560560 await waitForRuleSuccessOrStatus ( supertest , id ) ;
561561 await waitForSignalsToBePresent ( supertest , 4 , [ id ] ) ;
562562 const signalsOpen = await getSignalsById ( supertest , id ) ;
563- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
563+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
564564 expect ( hits ) . to . eql ( [
565565 {
566566 os : { type : 'macos' } ,
@@ -611,7 +611,7 @@ export default ({ getService }: FtrProviderContext) => {
611611 await waitForRuleSuccessOrStatus ( supertest , id ) ;
612612 await waitForSignalsToBePresent ( supertest , 4 , [ id ] ) ;
613613 const signalsOpen = await getSignalsById ( supertest , id ) ;
614- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
614+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
615615 expect ( hits ) . to . eql ( [
616616 {
617617 os : { type : 'macos' } ,
@@ -663,7 +663,7 @@ export default ({ getService }: FtrProviderContext) => {
663663 await waitForRuleSuccessOrStatus ( supertest , id ) ;
664664 await waitForSignalsToBePresent ( supertest , 1 , [ id ] ) ;
665665 const signalsOpen = await getSignalsById ( supertest , id ) ;
666- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
666+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
667667 expect ( hits ) . to . eql ( [
668668 {
669669 os : { type : 'macos' } ,
@@ -703,7 +703,7 @@ export default ({ getService }: FtrProviderContext) => {
703703 await waitForRuleSuccessOrStatus ( supertest , id ) ;
704704 await waitForSignalsToBePresent ( supertest , 1 , [ id ] ) ;
705705 const signalsOpen = await getSignalsById ( supertest , id ) ;
706- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
706+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
707707 expect ( hits ) . to . eql ( [
708708 {
709709 os : { type : 'macos' } ,
@@ -736,7 +736,7 @@ export default ({ getService }: FtrProviderContext) => {
736736 await waitForRuleSuccessOrStatus ( supertest , id ) ;
737737 await waitForSignalsToBePresent ( supertest , 3 , [ id ] ) ;
738738 const signalsOpen = await getSignalsById ( supertest , id ) ;
739- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
739+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
740740 expect ( hits ) . to . eql ( [
741741 {
742742 os : { type : 'linux' } ,
@@ -773,7 +773,7 @@ export default ({ getService }: FtrProviderContext) => {
773773 await waitForRuleSuccessOrStatus ( supertest , id ) ;
774774 await waitForSignalsToBePresent ( supertest , 2 , [ id ] ) ;
775775 const signalsOpen = await getSignalsById ( supertest , id ) ;
776- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
776+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
777777 expect ( hits ) . to . eql ( [
778778 {
779779 os : { type : 'macos' } ,
@@ -807,7 +807,7 @@ export default ({ getService }: FtrProviderContext) => {
807807 await waitForRuleSuccessOrStatus ( supertest , id ) ;
808808 await waitForSignalsToBePresent ( supertest , 2 , [ id ] ) ;
809809 const signalsOpen = await getSignalsById ( supertest , id ) ;
810- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
810+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
811811 expect ( hits ) . to . eql ( [
812812 {
813813 os : { type : 'macos' } ,
@@ -841,7 +841,7 @@ export default ({ getService }: FtrProviderContext) => {
841841 await waitForRuleSuccessOrStatus ( supertest , id ) ;
842842 await waitForSignalsToBePresent ( supertest , 4 , [ id ] ) ;
843843 const signalsOpen = await getSignalsById ( supertest , id ) ;
844- const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source . host ) ;
844+ const hits = signalsOpen . hits . hits . map ( ( hit ) => hit . _source ? .host ) ;
845845 expect ( hits ) . to . eql ( [
846846 {
847847 os : { type : 'linux' } ,
0 commit comments