11import { expect } from 'chai' ;
22
33import {
4- BSON ,
54 type Collection ,
65 type Db ,
76 MongoAPIError ,
87 type MongoClient ,
98 type WithId
10- } from '../../../mongodb' ;
9+ } from '../../../../src' ;
10+ import { BSONError , type Document , Long } from '../../../../src/bson' ;
1111
1212describe ( 'useBigInt64 option' , function ( ) {
1313 let client : MongoClient ;
@@ -93,7 +93,7 @@ describe('useBigInt64 option', function () {
9393 } ) ;
9494
9595 describe ( 'when set to true at collection level' , function ( ) {
96- let res : WithId < BSON . Document > | null ;
96+ let res : WithId < Document > | null ;
9797
9898 beforeEach ( async function ( ) {
9999 client = await this . configuration . newClient ( ) . connect ( ) ;
@@ -112,7 +112,7 @@ describe('useBigInt64 option', function () {
112112 } ) ;
113113
114114 describe ( 'when set to false at collection level' , function ( ) {
115- let res : WithId < BSON . Document > | null ;
115+ let res : WithId < Document > | null ;
116116
117117 beforeEach ( async function ( ) {
118118 client = await this . configuration . newClient ( ) . connect ( ) ;
@@ -131,7 +131,7 @@ describe('useBigInt64 option', function () {
131131 } ) ;
132132
133133 describe ( 'when set to true' , function ( ) {
134- let res : WithId < BSON . Document > | null ;
134+ let res : WithId < Document > | null ;
135135
136136 beforeEach ( async function ( ) {
137137 client = await this . configuration . newClient ( { } , { useBigInt64 : true } ) . connect ( ) ;
@@ -140,7 +140,7 @@ describe('useBigInt64 option', function () {
140140 await db . dropCollection ( 'useBigInt64Test' ) . catch ( ( ) => null ) ;
141141
142142 coll = await db . createCollection ( 'useBigInt64Test' ) ;
143- await coll . insertOne ( { a : new BSON . Long ( 1 ) } ) ;
143+ await coll . insertOne ( { a : new Long ( 1 ) } ) ;
144144
145145 res = await coll . findOne ( { a : 1n } ) ;
146146 } ) ;
@@ -185,7 +185,7 @@ describe('useBigInt64 option', function () {
185185 . listCollections ( )
186186 . toArray ( )
187187 . catch ( e => e ) ;
188- expect ( e ) . to . be . instanceOf ( BSON . BSONError ) ;
188+ expect ( e ) . to . be . instanceOf ( BSONError ) ;
189189 } ) ;
190190 } ) ;
191191
@@ -202,7 +202,7 @@ describe('useBigInt64 option', function () {
202202 . insertOne ( { name : 'bailey ' } )
203203 . then ( ( ) => null )
204204 . catch ( e => e ) ;
205- expect ( e ) . to . be . instanceOf ( BSON . BSONError ) ;
205+ expect ( e ) . to . be . instanceOf ( BSONError ) ;
206206 } ) ;
207207 } ) ;
208208
@@ -219,7 +219,7 @@ describe('useBigInt64 option', function () {
219219 . insertOne ( { a : 10n } , { promoteLongs : false , useBigInt64 : true } )
220220 . catch ( e => e ) ;
221221
222- expect ( e ) . to . be . instanceOf ( BSON . BSONError ) ;
222+ expect ( e ) . to . be . instanceOf ( BSONError ) ;
223223 } ) ;
224224 } ) ;
225225 } ) ;
@@ -257,7 +257,7 @@ describe('useBigInt64 option', function () {
257257 . listCollections ( )
258258 . toArray ( )
259259 . catch ( e => e ) ;
260- expect ( e ) . to . be . instanceOf ( BSON . BSONError ) ;
260+ expect ( e ) . to . be . instanceOf ( BSONError ) ;
261261 } ) ;
262262 } ) ;
263263
@@ -274,7 +274,7 @@ describe('useBigInt64 option', function () {
274274 . insertOne ( { name : 'bailey ' } )
275275 . then ( ( ) => null )
276276 . catch ( e => e ) ;
277- expect ( e ) . to . be . instanceOf ( BSON . BSONError ) ;
277+ expect ( e ) . to . be . instanceOf ( BSONError ) ;
278278 } ) ;
279279 } ) ;
280280
@@ -290,7 +290,7 @@ describe('useBigInt64 option', function () {
290290 . insertOne ( { a : 10n } , { promoteValues : false , useBigInt64 : true } )
291291 . catch ( e => e ) ;
292292
293- expect ( e ) . to . be . instanceOf ( BSON . BSONError ) ;
293+ expect ( e ) . to . be . instanceOf ( BSONError ) ;
294294 } ) ;
295295 } ) ;
296296 } ) ;
0 commit comments