@@ -174,7 +174,10 @@ describe('useBigInt64 option', function () {
174174 } ) ;
175175
176176 it ( 'throws a BSONError' , async function ( ) {
177- const e = await db . createCollection ( 'bsonError' ) . catch ( e => e ) ;
177+ const e = await db
178+ . aggregate ( [ ] )
179+ . toArray ( )
180+ . catch ( e => e ) ;
178181 expect ( e ) . to . be . instanceOf ( BSON . BSONError ) ;
179182 } ) ;
180183 } ) ;
@@ -186,8 +189,11 @@ describe('useBigInt64 option', function () {
186189 } ) ;
187190
188191 it ( 'throws a BSONError' , async function ( ) {
189- const e = await db
190- . createCollection ( 'bsonError' , { promoteLongs : false , useBigInt64 : true } )
192+ const collection = db . collection ( 'bsonError' , { promoteLongs : false , useBigInt64 : true } ) ;
193+
194+ const e = await collection
195+ . insertOne ( { name : 'bailey ' } )
196+ . then ( ( ) => null )
191197 . catch ( e => e ) ;
192198 expect ( e ) . to . be . instanceOf ( BSON . BSONError ) ;
193199 } ) ;
@@ -233,7 +239,10 @@ describe('useBigInt64 option', function () {
233239 } ) ;
234240
235241 it ( 'throws a BSONError' , async function ( ) {
236- const e = await db . createCollection ( 'bsonError' ) . catch ( e => e ) ;
242+ const e = await db
243+ . aggregate ( [ ] )
244+ . toArray ( )
245+ . catch ( e => e ) ;
237246 expect ( e ) . to . be . instanceOf ( BSON . BSONError ) ;
238247 } ) ;
239248 } ) ;
@@ -245,8 +254,11 @@ describe('useBigInt64 option', function () {
245254 } ) ;
246255
247256 it ( 'throws a BSONError' , async function ( ) {
248- const e = await db
249- . createCollection ( 'bsonError' , { promoteValues : false , useBigInt64 : true } )
257+ const collection = db . collection ( 'bsonError' , { promoteValues : false , useBigInt64 : true } ) ;
258+
259+ const e = await collection
260+ . insertOne ( { name : 'bailey ' } )
261+ . then ( ( ) => null )
250262 . catch ( e => e ) ;
251263 expect ( e ) . to . be . instanceOf ( BSON . BSONError ) ;
252264 } ) ;
0 commit comments