@@ -437,30 +437,39 @@ describe('mongodb-build-info', function () {
437437 }
438438
439439 it ( 'reports CosmosDB' , async function ( ) {
440- for ( const uri of fixtures . COSMOS_DB_URI ) {
441- const result = await identifyServerName ( uri , fail , fail ) ;
440+ for ( const connectionString of fixtures . COSMOS_DB_URI ) {
441+ const result = await identifyServerName ( {
442+ connectionString,
443+ adminCommand : fail ,
444+ } ) ;
442445 expect ( result ) . to . equal ( 'cosmosdb' ) ;
443446 }
444447 } ) ;
445448
446449 it ( 'reports DocumentDB' , async function ( ) {
447- for ( const uri of fixtures . DOCUMENT_DB_URIS ) {
448- const result = await identifyServerName ( uri , fail , fail ) ;
450+ for ( const connectionString of fixtures . DOCUMENT_DB_URIS ) {
451+ const result = await identifyServerName ( {
452+ connectionString,
453+ adminCommand : fail ,
454+ } ) ;
449455 expect ( result ) . to . equal ( 'documentdb' ) ;
450456 }
451457 } ) ;
452458
453459 it ( 'reports Firestore' , async function ( ) {
454- for ( const uri of fixtures . FIRESTORE_URIS ) {
455- const result = await identifyServerName ( uri , fail , fail ) ;
460+ for ( const connectionString of fixtures . FIRESTORE_URIS ) {
461+ const result = await identifyServerName ( {
462+ connectionString,
463+ adminCommand : fail ,
464+ } ) ;
456465 expect ( result ) . to . equal ( 'firestore' ) ;
457466 }
458467 } ) ;
459468
460469 it ( 'reports FerretDB' , async function ( ) {
461- const result = await identifyServerName (
462- '' ,
463- ( req ) => {
470+ const result = await identifyServerName ( {
471+ connectionString : '' ,
472+ adminCommand ( req ) {
464473 if ( 'buildInfo' in req ) {
465474 return Promise . resolve ( {
466475 ferretdb : { } ,
@@ -469,16 +478,14 @@ describe('mongodb-build-info', function () {
469478 return Promise . resolve ( { } ) ;
470479 }
471480 } ,
472- fail ,
473- ) ;
481+ } ) ;
474482 expect ( result ) . to . equal ( 'ferretdb' ) ;
475483 } ) ;
476484
477485 it ( 'reports PG DocumentDB' , async function ( ) {
478- const result = await identifyServerName (
479- '' ,
480- ( ) => Promise . resolve ( { } ) ,
481- ( req ) => {
486+ const result = await identifyServerName ( {
487+ connectionString : '' ,
488+ adminCommand ( req ) {
482489 if ( 'getParameter' in req ) {
483490 return Promise . reject (
484491 new Error (
@@ -489,7 +496,7 @@ describe('mongodb-build-info', function () {
489496 return Promise . resolve ( { } ) ;
490497 }
491498 } ,
492- ) ;
499+ } ) ;
493500 expect ( result ) . to . equal ( 'pg_documentdb' ) ;
494501 } ) ;
495502 } ) ;
0 commit comments