@@ -57,7 +57,6 @@ describe('setupLoggerAndTelemetry', () => {
57
57
bus . emit ( 'mongosh:api-call' , { method : 'auth' , class : 'Database' , db : 'test-1603986682000' , arguments : { } } ) ;
58
58
bus . emit ( 'mongosh:api-call' , { method :
'redactable' , arguments :
{ filter :
{ email :
'[email protected] ' } } } ) ;
59
59
bus . emit ( 'mongosh:evaluate-input' , { input : '1+1' } ) ;
60
- bus . emit ( 'mongosh:driver-initialized' , { driver : { name : 'nodejs' , version : '3.6.1' } } ) ;
61
60
62
61
const circular : any = { } ;
63
62
circular . circular = circular ;
@@ -87,6 +86,12 @@ describe('setupLoggerAndTelemetry', () => {
87
86
bus . emit ( 'mongosh-snippets:snippet-command' , { args : [ 'install' , 'foo' ] } ) ;
88
87
bus . emit ( 'mongosh-snippets:transform-error' , { error : 'failed' , addition : 'oh no' , name : 'foo' } ) ;
89
88
89
+ const connAttemptData = {
90
+ driver : { name : 'nodejs' , version : '3.6.1' } ,
91
+ serviceProviderVersion : '1.0.0' ,
92
+ host : 'localhost'
93
+ } ;
94
+ bus . emit ( 'mongosh-sp:connect-attempt-initialized' , connAttemptData ) ;
90
95
bus . emit ( 'mongosh-sp:connect-heartbeat-failure' , { connectionId : 'localhost' , failure : new Error ( 'cause' ) , isFailFast : true , isKnownServer : true } ) ;
91
96
bus . emit ( 'mongosh-sp:connect-heartbeat-succeeded' , { connectionId : 'localhost' } ) ;
92
97
bus . emit ( 'mongosh-sp:connect-fail-early' ) ;
@@ -128,8 +133,6 @@ describe('setupLoggerAndTelemetry', () => {
128
133
expect ( logOutput [ i ++ ] . attr . arguments . filter . email ) . to . equal ( '<email>' ) ;
129
134
expect ( logOutput [ i ] . msg ) . to . equal ( 'Evaluating input' ) ;
130
135
expect ( logOutput [ i ++ ] . attr . input ) . to . equal ( '1+1' ) ;
131
- expect ( logOutput [ i ] . msg ) . to . equal ( 'Driver initialized' ) ;
132
- expect ( logOutput [ i ++ ] . attr . driver . version ) . to . equal ( '3.6.1' ) ;
133
136
expect ( logOutput [ i ] . msg ) . to . equal ( 'Performed API call' ) ;
134
137
expect ( logOutput [ i ++ ] . attr . _inspected ) . to . match ( / c i r c u l a r / ) ;
135
138
expect ( logOutput [ i ++ ] . msg ) . to . equal ( 'Start loading CLI scripts' ) ;
@@ -169,6 +172,8 @@ describe('setupLoggerAndTelemetry', () => {
169
172
expect ( logOutput [ i ++ ] . attr ) . to . deep . equal ( { args : [ 'install' , 'foo' ] } ) ;
170
173
expect ( logOutput [ i ] . msg ) . to . equal ( 'Rewrote error message' ) ;
171
174
expect ( logOutput [ i ++ ] . attr ) . to . deep . equal ( { error : 'failed' , addition : 'oh no' , name : 'foo' } ) ;
175
+ expect ( logOutput [ i ] . msg ) . to . equal ( 'Initiating connection attempt' ) ;
176
+ expect ( logOutput [ i ++ ] . attr ) . to . deep . equal ( connAttemptData ) ;
172
177
expect ( logOutput [ i ] . msg ) . to . equal ( 'Server heartbeat failure' ) ;
173
178
expect ( logOutput [ i ++ ] . attr ) . to . deep . equal ( { connectionId : 'localhost' , failure : 'cause' , isFailFast : true , isKnownServer : true } ) ;
174
179
expect ( logOutput [ i ] . msg ) . to . equal ( 'Server heartbeat succeeded' ) ;
0 commit comments