1+ import { type EventEmitter , once } from 'node:events' ;
2+ import { setTimeout } from 'node:timers' ;
3+
14import { expect } from 'chai' ;
2- import { type EventEmitter , once } from 'events' ;
35import * as sinon from 'sinon' ;
4- import { setTimeout } from 'timers' ;
56
67import {
78 addContainerMetadata ,
@@ -173,7 +174,7 @@ describe('Connection', function () {
173174 metadata : {
174175 requires : { topology : 'single' , os : '!win32' }
175176 } ,
176- test : function ( done ) {
177+ test : async function ( ) {
177178 const configuration = this . configuration ;
178179 const uri = `mongodb://${ encodeURIComponent ( '/tmp/mongodb-27017.sock' ) } ?w=1` ;
179180 const options : MongoClientOptions = {
@@ -186,22 +187,10 @@ describe('Connection', function () {
186187
187188 const db = client . db ( configuration . db ) ;
188189
189- db . collection ( 'domainSocketCollection0' ) . insert (
190- { a : 1 } ,
191- { writeConcern : { w : 1 } } ,
192- function ( err ) {
193- expect ( err ) . to . not . exist ;
194-
195- db . collection ( 'domainSocketCollection0' )
196- . find ( { a : 1 } )
197- . toArray ( function ( err , items ) {
198- expect ( err ) . to . not . exist ;
199- test . equal ( 1 , items . length ) ;
190+ await db . collection ( 'domainSocketCollection0' ) . insert ( { a : 1 } , { writeConcern : { w : 1 } } ) ;
200191
201- done ( ) ;
202- } ) ;
203- }
204- ) ;
192+ const items = await db . collection ( 'domainSocketCollection0' ) . find ( { a : 1 } ) . toArray ( ) ;
193+ test . equal ( 1 , items . length ) ;
205194 }
206195 } ) ;
207196
0 commit comments