@@ -27,12 +27,13 @@ describe('Connection', function () {
27
27
it ( 'should execute a command against a server' , {
28
28
metadata : { requires : { apiVersion : false , topology : '!load-balanced' } } ,
29
29
test : function ( done ) {
30
- const connectOptions = Object . assign (
31
- { connectionType : Connection } ,
32
- this . configuration . options
33
- ) ;
30
+ const connectOptions : Partial < ConnectionOptions > = {
31
+ connectionType : Connection ,
32
+ ...this . configuration . options ,
33
+ metadata : makeClientMetadata ( { driverInfo : { } } )
34
+ } ;
34
35
35
- connect ( connectOptions , ( err , conn ) => {
36
+ connect ( connectOptions as any as ConnectionOptions , ( err , conn ) => {
36
37
expect ( err ) . to . not . exist ;
37
38
this . defer ( _done => conn . destroy ( _done ) ) ;
38
39
@@ -49,12 +50,14 @@ describe('Connection', function () {
49
50
it ( 'should emit command monitoring events' , {
50
51
metadata : { requires : { apiVersion : false , topology : '!load-balanced' } } ,
51
52
test : function ( done ) {
52
- const connectOptions = Object . assign (
53
- { connectionType : Connection , monitorCommands : true } ,
54
- this . configuration . options
55
- ) ;
56
-
57
- connect ( connectOptions , ( err , conn ) => {
53
+ const connectOptions : Partial < ConnectionOptions > = {
54
+ connectionType : Connection ,
55
+ monitorCommands : true ,
56
+ ...this . configuration . options ,
57
+ metadata : makeClientMetadata ( { driverInfo : { } } )
58
+ } ;
59
+
60
+ connect ( connectOptions as any as ConnectionOptions , ( err , conn ) => {
58
61
expect ( err ) . to . not . exist ;
59
62
this . defer ( _done => conn . destroy ( _done ) ) ;
60
63
@@ -80,12 +83,13 @@ describe('Connection', function () {
80
83
} ,
81
84
test : function ( done ) {
82
85
const namespace = ns ( `${ this . configuration . db } .$cmd` ) ;
83
- const connectOptions = Object . assign (
84
- { connectionType : Connection } ,
85
- this . configuration . options
86
- ) ;
86
+ const connectOptions : Partial < ConnectionOptions > = {
87
+ connectionType : Connection ,
88
+ ...this . configuration . options ,
89
+ metadata : makeClientMetadata ( { driverInfo : { } } )
90
+ } ;
87
91
88
- connect ( connectOptions , ( err , conn ) => {
92
+ connect ( connectOptions as any as ConnectionOptions , ( err , conn ) => {
89
93
expect ( err ) . to . not . exist ;
90
94
this . defer ( _done => conn . destroy ( _done ) ) ;
91
95
0 commit comments