File tree Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Expand file tree Collapse file tree 1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ describe('Topology (unit)', function () {
46
46
done ( ) ;
47
47
} ) ;
48
48
49
- it ( 'should report the correct platform in client metadata' , function ( done ) {
49
+ it ( 'should report the correct platform in client metadata' , async function ( ) {
50
50
const helloRequests = [ ] ;
51
51
mockServer . setMessageHandler ( request => {
52
52
const doc = request . document ;
@@ -59,22 +59,17 @@ describe('Topology (unit)', function () {
59
59
} ) ;
60
60
61
61
client = new MongoClient ( `mongodb://${ mockServer . uri ( ) } /` ) ;
62
- client . connect ( err => {
63
- expect ( err ) . to . not . exist ;
64
62
65
- client . db ( ) . command ( { ping : 1 } , err => {
66
- expect ( err ) . to . not . exist ;
63
+ await client . connect ( ) ;
67
64
68
- expect ( helloRequests ) . to . have . length . greaterThan ( 1 ) ;
69
- helloRequests . forEach ( helloRequest =>
70
- expect ( helloRequest )
71
- . nested . property ( 'client.platform' )
72
- . to . match ( / u n i f i e d / )
73
- ) ;
65
+ await client . db ( ) . command ( { ping : 1 } ) ;
74
66
75
- done ( ) ;
76
- } ) ;
77
- } ) ;
67
+ expect ( helloRequests ) . to . have . length . greaterThan ( 1 ) ;
68
+ for ( const request of helloRequests ) {
69
+ expect ( request )
70
+ . nested . property ( 'client.platform' )
71
+ . to . match ( / N o d e .j s / ) ;
72
+ }
78
73
} ) ;
79
74
} ) ;
80
75
You can’t perform that action at this time.
0 commit comments