@@ -22,6 +22,11 @@ describe('isReady script', () => {
2222 const state = JSON . stringify ( { status : 'ready' , containers : { } } )
2323 process . argv = [ ] ;
2424 proxyquire ( '../lib/isReady.js' , {
25+ '@codefresh-io/cf-telemetry/init' : {
26+ terminate : ( ) => ( {
27+ finally : callback => callback ( ) ,
28+ } )
29+ } ,
2530 'fs' : {
2631 readFileSync : ( ) => Buffer . from ( state ) ,
2732 } ,
@@ -32,6 +37,11 @@ describe('isReady script', () => {
3237 const state = JSON . stringify ( { status : 'notReady' , containers : { } } )
3338 process . argv = [ ] ;
3439 proxyquire ( '../lib/isReady.js' , {
40+ '@codefresh-io/cf-telemetry/init' : {
41+ terminate : ( ) => ( {
42+ finally : callback => callback ( ) ,
43+ } )
44+ } ,
3545 'fs' : {
3646 readFileSync : ( ) => Buffer . from ( state ) ,
3747 } ,
@@ -44,6 +54,11 @@ describe('isReady script', () => {
4454 const state = JSON . stringify ( { status : 'ready' , containers : { 'container-id' : { status : ContainerHandlingStatus . LISTENING } } } )
4555 process . argv = [ 'foo' , 'bar' , 'container-id' ] ;
4656 proxyquire ( '../lib/isReady.js' , {
57+ '@codefresh-io/cf-telemetry/init' : {
58+ terminate : ( ) => ( {
59+ finally : callback => callback ( ) ,
60+ } )
61+ } ,
4762 'fs' : {
4863 readFileSync : ( ) => Buffer . from ( state ) ,
4964 } ,
@@ -54,6 +69,11 @@ describe('isReady script', () => {
5469 const state = JSON . stringify ( { status : 'ready' , containers : { 'container-id' : { status : ContainerHandlingStatus . WAITING_FOR_START } } } )
5570 process . argv = [ 'foo' , 'bar' , 'container-id' ] ;
5671 proxyquire ( '../lib/isReady.js' , {
72+ '@codefresh-io/cf-telemetry/init' : {
73+ terminate : ( ) => ( {
74+ finally : callback => callback ( ) ,
75+ } )
76+ } ,
5777 'fs' : {
5878 readFileSync : ( ) => Buffer . from ( state ) ,
5979 } ,
@@ -64,6 +84,11 @@ describe('isReady script', () => {
6484 const state = JSON . stringify ( { status : 'ready' , containers : { 'container-id' : { status : ContainerHandlingStatus . FINISHED } } } )
6585 process . argv = [ 'foo' , 'bar' , 'container-id' ] ;
6686 proxyquire ( '../lib/isReady.js' , {
87+ '@codefresh-io/cf-telemetry/init' : {
88+ terminate : ( ) => ( {
89+ finally : callback => callback ( ) ,
90+ } )
91+ } ,
6792 'fs' : {
6893 readFileSync : ( ) => Buffer . from ( state ) ,
6994 } ,
@@ -74,11 +99,16 @@ describe('isReady script', () => {
7499 const state = JSON . stringify ( { status : 'ready' , containers : { 'container-id' : { status : ContainerHandlingStatus . INITIALIZING } } } )
75100 process . argv = [ 'foo' , 'bar' , 'container-id' ] ;
76101 proxyquire ( '../lib/isReady.js' , {
102+ '@codefresh-io/cf-telemetry/init' : {
103+ terminate : ( ) => ( {
104+ finally : callback => callback ( ) ,
105+ } )
106+ } ,
77107 'fs' : {
78108 readFileSync : ( ) => Buffer . from ( state ) ,
79109 } ,
80110 } ) ;
81111 expect ( process . exit ) . to . have . been . calledOnceWith ( 1 ) ;
82112 } ) ;
83113 } ) ;
84- } ) ;
114+ } ) ;
0 commit comments