Skip to content

Commit e0e2b80

Browse files
fixes
1 parent cf2d3ed commit e0e2b80

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

src/operations/list_databases.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BSONType, type Connection } from '..';
1+
import { type Connection } from '..';
22
import type { Document } from '../bson';
33
import { MongoDBResponse } from '../cmap/wire_protocol/responses';
44
import type { Db } from '../db';

test/integration/node-specific/bson-options/use_bigint_64.test.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)