Skip to content

Commit 5429180

Browse files
fix: Address Daria's comments on PR
1 parent f87b53f commit 5429180

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

test/integration/change-streams/change_stream.test.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,23 @@ describe('Change Streams', function () {
204204
});
205205

206206
context('fullDocument', () => {
207-
it('sets fullDocument to `undefined` if no value is passed', function () {
207+
it('does not set fullDocument if no value is provided', function () {
208208
const changeStream = client.watch();
209209

210210
expect(changeStream).not.to.have.nested.property(
211211
'cursor.pipeline[0].$changeStream.fullDocument'
212212
);
213213
});
214214

215+
it('does not validate the value passed in for the `fullDocument` property', function () {
216+
const changeStream = client.watch([], { fullDocument: 'invalid value' });
217+
218+
expect(changeStream).to.have.nested.property(
219+
'cursor.pipeline[0].$changeStream.fullDocument',
220+
'invalid value'
221+
);
222+
});
223+
215224
it('assigns `fullDocument` to the correct value if it is passed as an option', function () {
216225
const changeStream = client.watch([], { fullDocument: 'updateLookup' });
217226

@@ -232,15 +241,15 @@ describe('Change Streams', function () {
232241
);
233242
});
234243

235-
it('does not assigns `allChangesForCluster` if the ChangeStream.type is Db', function () {
244+
it('does not assign `allChangesForCluster` if the ChangeStream.type is Db', function () {
236245
const changeStream = db.watch();
237246

238247
expect(changeStream).not.to.have.nested.property(
239248
'cursor.pipeline[0].$changeStream.allChangesForCluster'
240249
);
241250
});
242251

243-
it('does not assign `allChangesForCluster` if the ChangeStream.type is Db', function () {
252+
it('does not assign `allChangesForCluster` if the ChangeStream.type is Collection', function () {
244253
const changeStream = collection.watch();
245254

246255
expect(changeStream).not.to.have.nested.property(

test/types/change_streams.test-d.ts

-11
This file was deleted.

0 commit comments

Comments
 (0)