From c9202b6cf2e47f4957c565f4d80aa05fb589374d Mon Sep 17 00:00:00 2001 From: Durran Jordan Date: Wed, 10 Nov 2021 13:47:01 +0100 Subject: [PATCH] test(NODE-3692): update to check TSchema --- test/types/mongodb.test-d.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/types/mongodb.test-d.ts b/test/types/mongodb.test-d.ts index 267ded4108d..ea8f26c16aa 100644 --- a/test/types/mongodb.test-d.ts +++ b/test/types/mongodb.test-d.ts @@ -3,7 +3,7 @@ import { MongoClient } from '../../src/mongo_client'; import { Collection } from '../../src/collection'; import { AggregationCursor } from '../../src/cursor/aggregation_cursor'; import type { FindCursor } from '../../src/cursor/find_cursor'; -import type { ChangeStream, ChangeStreamDocument } from '../../src/change_stream'; +import type { ChangeStreamDocument } from '../../src/change_stream'; import type { Document } from 'bson'; import { Db } from '../../src'; import { Topology } from '../../src/sdam/topology'; @@ -20,6 +20,9 @@ expectDeprecated(Db.prototype.unref); expectDeprecated(MongoDBDriver.ObjectID); expectNotDeprecated(MongoDBDriver.ObjectId); +interface TSchema extends Document { +} + // test mapped cursor types const client = new MongoClient(''); const coll = client.db('test').collection('test'); @@ -40,14 +43,14 @@ expectType>(composedMap); expectType(await composedMap.next()); expectType(await composedMap.toArray()); const changeStream = coll.watch(); -changeStream.on('init', (doc) => { - expectType(doc); +changeStream.on('init', doc => { + expectType(doc); }); -changeStream.on('more', (doc) => { - expectType(doc); +changeStream.on('more', doc => { + expectType(doc); }); -changeStream.on('change', (doc) => { - expectType>(doc); +changeStream.on('change', doc => { + expectType>(doc); }); const builtCursor = coll.aggregate();