File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -88,5 +88,17 @@ describe("Session", () => {
8888 // Should include the client name in the appName
8989 expect ( connectionString ) . toContain ( "--test-device-id--test-client" ) ;
9090 } ) ;
91+
92+ it ( "should use 'unknown' for client name when agent runner is not set" , async ( ) => {
93+ await session . connectToMongoDB ( "mongodb://localhost:27017" , config . connectOptions ) ;
94+ expect ( session . serviceProvider ) . toBeDefined ( ) ;
95+
96+ const connectMock = MockNodeDriverServiceProvider . connect ;
97+ expect ( connectMock ) . toHaveBeenCalledOnce ( ) ;
98+ const connectionString = connectMock . mock . calls [ 0 ] ?. [ 0 ] ;
99+
100+ // Should use 'unknown' for client name when agent runner is not set
101+ expect ( connectionString ) . toContain ( "--test-device-id--unknown" ) ;
102+ } ) ;
91103 } ) ;
92104} ) ;
You can’t perform that action at this time.
0 commit comments