Skip to content

Commit 7acf218

Browse files
committed
test: fix ts in prose test
1 parent 80a8b38 commit 7acf218

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

test/integration/crud/crud.prose.test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { once } from 'events';
33

44
import { type CommandStartedEvent } from '../../../mongodb';
55
import {
6-
type AnyClientBulkWriteModel,
6+
type ClientBulkWriteModel,
77
type ClientSession,
88
type Collection,
99
type Document,
@@ -176,7 +176,7 @@ describe('CRUD Prose Spec Tests', () => {
176176
// firstEvent.operationId is equal to secondEvent.operationId.
177177
let client: MongoClient;
178178
let maxWriteBatchSize;
179-
let models: AnyClientBulkWriteModel<Document>[] = [];
179+
let models: ClientBulkWriteModel<Document>[] = [];
180180
const commands: CommandStartedEvent[] = [];
181181

182182
beforeEach(async function () {
@@ -244,7 +244,7 @@ describe('CRUD Prose Spec Tests', () => {
244244
let maxBsonObjectSize;
245245
let maxMessageSizeBytes;
246246
let numModels;
247-
let models: AnyClientBulkWriteModel<Document>[] = [];
247+
let models: ClientBulkWriteModel<Document>[] = [];
248248
const commands: CommandStartedEvent[] = [];
249249

250250
beforeEach(async function () {
@@ -315,7 +315,7 @@ describe('CRUD Prose Spec Tests', () => {
315315
// Assert that two CommandStartedEvents were observed for the bulkWrite command.
316316
let client: MongoClient;
317317
let maxWriteBatchSize;
318-
let models: AnyClientBulkWriteModel<Document>[] = [];
318+
let models: ClientBulkWriteModel<Document>[] = [];
319319
const commands: CommandStartedEvent[] = [];
320320

321321
beforeEach(async function () {
@@ -383,15 +383,15 @@ describe('CRUD Prose Spec Tests', () => {
383383
// Construct a list of write models (referred to as models) with model repeated maxWriteBatchSize + 1 times.
384384
let client: MongoClient;
385385
let maxWriteBatchSize;
386-
let models: AnyClientBulkWriteModel<Document>[] = [];
386+
let models: ClientBulkWriteModel<Document>[] = [];
387387
const commands: CommandStartedEvent[] = [];
388388

389389
beforeEach(async function () {
390390
client = this.configuration.newClient({}, { monitorCommands: true, retryWrites: false });
391391
await client.connect();
392392
await client.db('db').collection('coll').drop();
393393
const hello = await client.db('admin').command({ hello: 1 });
394-
await client.db('db').collection('coll').insertOne({ _id: 1 });
394+
await client.db('db').collection<{ _id?: number }>('coll').insertOne({ _id: 1 });
395395
maxWriteBatchSize = hello.maxWriteBatchSize;
396396

397397
client.on('commandStarted', filterForCommands('bulkWrite', commands));
@@ -472,7 +472,7 @@ describe('CRUD Prose Spec Tests', () => {
472472
// Assert that a CommandStartedEvent was observed for the getMore command.
473473
let client: MongoClient;
474474
let maxBsonObjectSize;
475-
const models: AnyClientBulkWriteModel<Document>[] = [];
475+
const models: ClientBulkWriteModel<Document>[] = [];
476476
const commands: CommandStartedEvent[] = [];
477477

478478
beforeEach(async function () {
@@ -546,7 +546,7 @@ describe('CRUD Prose Spec Tests', () => {
546546
let client: MongoClient;
547547
let session: ClientSession;
548548
let maxBsonObjectSize;
549-
const models: AnyClientBulkWriteModel<Document>[] = [];
549+
const models: ClientBulkWriteModel<Document>[] = [];
550550
const commands: CommandStartedEvent[] = [];
551551

552552
beforeEach(async function () {
@@ -633,7 +633,7 @@ describe('CRUD Prose Spec Tests', () => {
633633
// Assert that a CommandStartedEvent was observed for the killCursors command.
634634
let client: MongoClient;
635635
let maxBsonObjectSize;
636-
const models: AnyClientBulkWriteModel<Document>[] = [];
636+
const models: ClientBulkWriteModel<Document>[] = [];
637637
const getMoreCommands: CommandStartedEvent[] = [];
638638
const killCursorsCommands: CommandStartedEvent[] = [];
639639

@@ -804,7 +804,7 @@ describe('CRUD Prose Spec Tests', () => {
804804
let opsBytes;
805805
let numModels;
806806
let remainderBytes;
807-
let models: AnyClientBulkWriteModel<Document>[] = [];
807+
let models: ClientBulkWriteModel<Document>[] = [];
808808
const commands: CommandStartedEvent[] = [];
809809

810810
beforeEach(async function () {
@@ -860,7 +860,7 @@ describe('CRUD Prose Spec Tests', () => {
860860
it('executes in a single batch', {
861861
metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } },
862862
async test() {
863-
const sameNamespaceModel: AnyClientBulkWriteModel<Document> = {
863+
const sameNamespaceModel: ClientBulkWriteModel<Document> = {
864864
name: 'insertOne',
865865
namespace: 'db.coll',
866866
document: { a: 'b' }
@@ -897,7 +897,7 @@ describe('CRUD Prose Spec Tests', () => {
897897
metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } },
898898
async test() {
899899
const namespace = `db.${'c'.repeat(200)}`;
900-
const newNamespaceModel: AnyClientBulkWriteModel<Document> = {
900+
const newNamespaceModel: ClientBulkWriteModel<Document> = {
901901
name: 'insertOne',
902902
namespace: namespace,
903903
document: { a: 'b' }
@@ -951,7 +951,7 @@ describe('CRUD Prose Spec Tests', () => {
951951
it('raises a client error', {
952952
metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } },
953953
async test() {
954-
const model: AnyClientBulkWriteModel<Document> = {
954+
const model: ClientBulkWriteModel<Document> = {
955955
name: 'insertOne',
956956
namespace: 'db.coll',
957957
document: { a: 'b'.repeat(maxMessageSizeBytes) }
@@ -977,7 +977,7 @@ describe('CRUD Prose Spec Tests', () => {
977977
metadata: { requires: { mongodb: '>=8.0.0', serverless: 'forbid' } },
978978
async test() {
979979
const namespace = `db.${'c'.repeat(maxMessageSizeBytes)}`;
980-
const model: AnyClientBulkWriteModel<Document> = {
980+
const model: ClientBulkWriteModel<Document> = {
981981
name: 'insertOne',
982982
namespace: namespace,
983983
document: { a: 'b' }
@@ -1034,7 +1034,7 @@ describe('CRUD Prose Spec Tests', () => {
10341034
});
10351035

10361036
it('raises a client side error', async function () {
1037-
const model: AnyClientBulkWriteModel<Document> = {
1037+
const model: ClientBulkWriteModel<Document> = {
10381038
name: 'insertOne',
10391039
namespace: 'db.coll',
10401040
document: { a: 'b' }
@@ -1114,7 +1114,7 @@ describe('CRUD Prose Spec Tests', () => {
11141114
let maxBsonObjectSize;
11151115
let maxMessageSizeBytes;
11161116
let numModels;
1117-
let models: AnyClientBulkWriteModel<Document>[] = [];
1117+
let models: ClientBulkWriteModel<Document>[] = [];
11181118
const commands: CommandStartedEvent[] = [];
11191119

11201120
beforeEach(async function () {

0 commit comments

Comments
 (0)