@@ -335,52 +335,28 @@ describe('class MongoClient', function () {
335
335
} ) ;
336
336
} ) ;
337
337
338
- it ( 'Should correctly pass through appname' , {
339
- metadata : {
340
- requires : {
341
- topology : [ 'single' , 'replicaset' , 'sharded' ]
342
- }
343
- } ,
344
-
345
- test : function ( done ) {
346
- const configuration = this . configuration ;
347
- const options = {
348
- appName : 'hello world'
349
- } ;
350
- const client = configuration . newClient ( options ) ;
351
-
352
- client . connect ( function ( err , client ) {
353
- expect ( err ) . to . not . exist ;
354
- expect ( client )
355
- . to . have . nested . property ( 'topology.clientMetadata.application.name' )
356
- . to . equal ( 'hello world' ) ;
338
+ it ( 'Should correctly pass through appname' , async function ( ) {
339
+ const configuration = this . configuration ;
340
+ const options = {
341
+ appName : 'hello world'
342
+ } ;
343
+ const client = configuration . newClient ( options ) ;
357
344
358
- client . close ( done ) ;
359
- } ) ;
360
- }
345
+ const {
346
+ application : { name }
347
+ } = await client . options . metadata ;
348
+ expect ( name ) . to . equal ( 'hello world' ) ;
361
349
} ) ;
362
350
363
- it ( 'Should correctly pass through appname in options' , {
364
- metadata : {
365
- requires : {
366
- topology : [ 'single' , 'replicaset' , 'sharded' ]
367
- }
368
- } ,
369
-
370
- test : function ( done ) {
371
- const configuration = this . configuration ;
372
- const url = configuration . url ( ) ;
373
-
374
- const client = configuration . newClient ( url , { appname : 'hello world' } ) ;
375
- client . connect ( err => {
376
- expect ( err ) . to . not . exist ;
377
- expect ( client )
378
- . to . have . nested . property ( 'topology.clientMetadata.application.name' )
379
- . to . equal ( 'hello world' ) ;
351
+ it ( 'Should correctly pass through appname in options' , async function ( ) {
352
+ const configuration = this . configuration ;
353
+ const url = this . configuration . url ( ) ;
354
+ const client = configuration . newClient ( url , { appName : 'hello world' } ) ;
380
355
381
- client . close ( done ) ;
382
- } ) ;
383
- }
356
+ const {
357
+ application : { name }
358
+ } = await client . options . metadata ;
359
+ expect ( name ) . to . equal ( 'hello world' ) ;
384
360
} ) ;
385
361
386
362
it ( 'Should correctly pass through socketTimeoutMS and connectTimeoutMS' , {
0 commit comments