@@ -17,68 +17,68 @@ async function setUpCollection(client: MongoClient) {
17
17
describe ( 'explicit resource management smoke tests' , function ( ) {
18
18
describe ( 'MongoClient' , function ( ) {
19
19
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 ( ) ;
22
22
} )
23
23
} )
24
24
25
25
describe ( 'Cursors' , function ( ) {
26
26
it ( 'does not crash or error when used with await-using syntax' , async function ( ) {
27
27
await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
28
- await client . connect ( ) ;
28
+ await client . connect ( ) ;
29
29
30
- const collection = await setUpCollection ( client ) ;
30
+ const collection = await setUpCollection ( client ) ;
31
31
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 ( ) ;
36
36
} )
37
37
38
38
describe ( 'cursor streams' , function ( ) {
39
39
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 ( ) ;
42
42
43
- const collection = await setUpCollection ( client ) ;
43
+ const collection = await setUpCollection ( client ) ;
44
44
45
- await using readable = collection . find ( ) . stream ( ) ;
45
+ await using readable = collection . find ( ) . stream ( ) ;
46
46
} )
47
47
} )
48
48
} )
49
49
50
50
describe ( 'Sessions' , function ( ) {
51
51
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 ( ) ;
54
54
55
- await using session = client . startSession ( ) ;
55
+ await using session = client . startSession ( ) ;
56
56
} )
57
57
} )
58
58
59
59
describe ( 'ChangeStreams' , function ( ) {
60
60
it ( 'does not crash or error when used with await-using syntax' , async function ( ) {
61
61
await using client = new MongoClient ( process . env . MONGODB_URI ! ) ;
62
- await client . connect ( ) ;
62
+ await client . connect ( ) ;
63
63
64
- const collection = await setUpCollection ( client ) ;
65
- await using cs = collection . watch ( ) ;
64
+ const collection = await setUpCollection ( client ) ;
65
+ await using cs = collection . watch ( ) ;
66
66
67
- setTimeout ( 1000 ) . then ( ( ) => collection . insertOne ( { name : 'bailey' } ) ) ;
68
- await cs . next ( ) ;
67
+ setTimeout ( 1000 ) . then ( ( ) => collection . insertOne ( { name : 'bailey' } ) ) ;
68
+ await cs . next ( ) ;
69
69
} )
70
70
} ) ;
71
71
72
72
describe ( 'GridFSDownloadStream' , function ( ) {
73
73
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 ( ) ;
76
76
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 ) ;
80
80
81
- await using downloadStream = bucket . openDownloadStreamByName ( 'foo.txt' ) ;
81
+ await using downloadStream = bucket . openDownloadStreamByName ( 'foo.txt' ) ;
82
82
} )
83
83
} ) ;
84
84
} )
0 commit comments