@@ -17,68 +17,68 @@ async function setUpCollection(client: MongoClient) {
1717describe ( 'explicit resource management smoke tests' , function ( ) {
1818 describe ( 'MongoClient' , function ( ) {
1919 it ( 'does not crash or error when used with await-using syntax' , async function ( ) {
20- await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
21- await client . connect ( ) ;
20+ await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
21+ await client . connect ( ) ;
2222 } )
2323 } )
2424
2525 describe ( 'Cursors' , function ( ) {
2626 it ( 'does not crash or error when used with await-using syntax' , async function ( ) {
2727 await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
28- await client . connect ( ) ;
28+ await client . connect ( ) ;
2929
30- const collection = await setUpCollection ( client ) ;
30+ const collection = await setUpCollection ( client ) ;
3131
32- await using cursor = collection . find ( ) ;
33- await cursor . next ( ) ;
34- await cursor . next ( ) ;
35- await cursor . next ( ) ;
32+ await using cursor = collection . find ( ) ;
33+ await cursor . next ( ) ;
34+ await cursor . next ( ) ;
35+ await cursor . next ( ) ;
3636 } )
3737
3838 describe ( 'cursor streams' , function ( ) {
3939 it ( 'does not crash or error when used with await-using syntax' , async function ( ) {
40- await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
41- await client . connect ( ) ;
40+ await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
41+ await client . connect ( ) ;
4242
43- const collection = await setUpCollection ( client ) ;
43+ const collection = await setUpCollection ( client ) ;
4444
45- await using readable = collection . find ( ) . stream ( ) ;
45+ await using readable = collection . find ( ) . stream ( ) ;
4646 } )
4747 } )
4848 } )
4949
5050 describe ( 'Sessions' , function ( ) {
5151 it ( 'does not crash or error when used with await-using syntax' , async function ( ) {
52- await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
53- await client . connect ( ) ;
52+ await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
53+ await client . connect ( ) ;
5454
55- await using session = client . startSession ( ) ;
55+ await using session = client . startSession ( ) ;
5656 } )
5757 } )
5858
5959 describe ( 'ChangeStreams' , function ( ) {
6060 it ( 'does not crash or error when used with await-using syntax' , async function ( ) {
6161 await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
62- await client . connect ( ) ;
62+ await client . connect ( ) ;
6363
64- const collection = await setUpCollection ( client ) ;
65- await using cs = collection . watch ( ) ;
64+ const collection = await setUpCollection ( client ) ;
65+ await using cs = collection . watch ( ) ;
6666
67- setTimeout ( 1000 ) . then ( ( ) => collection . insertOne ( { name : 'bailey' } ) ) ;
68- await cs . next ( ) ;
67+ setTimeout ( 1000 ) . then ( ( ) => collection . insertOne ( { name : 'bailey' } ) ) ;
68+ await cs . next ( ) ;
6969 } )
7070 } ) ;
7171
7272 describe ( 'GridFSDownloadStream' , function ( ) {
7373 it ( 'does not crash or error when used with await-using syntax' , async function ( ) {
74- await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
75- await client . connect ( ) ;
74+ await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
75+ await client . connect ( ) ;
7676
77- const bucket = new GridFSBucket ( client . db ( 'foo' ) ) ;
78- const uploadStream = bucket . openUploadStream ( 'foo.txt' )
79- await pipeline ( Readable . from ( "AAAAAAA" . split ( '' ) ) , uploadStream ) ;
77+ const bucket = new GridFSBucket ( client . db ( 'foo' ) ) ;
78+ const uploadStream = bucket . openUploadStream ( 'foo.txt' )
79+ await pipeline ( Readable . from ( "AAAAAAA" . split ( '' ) ) , uploadStream ) ;
8080
81- await using downloadStream = bucket . openDownloadStreamByName ( 'foo.txt' ) ;
81+ await using downloadStream = bucket . openDownloadStreamByName ( 'foo.txt' ) ;
8282 } )
8383 } ) ;
8484} )
0 commit comments