Skip to content

Commit

Permalink
fix: Address Daria's comments on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Mar 15, 2022
1 parent f87b53f commit 5429180
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
15 changes: 12 additions & 3 deletions test/integration/change-streams/change_stream.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,23 @@ describe('Change Streams', function () {
});

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

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

it('does not validate the value passed in for the `fullDocument` property', function () {
const changeStream = client.watch([], { fullDocument: 'invalid value' });

expect(changeStream).to.have.nested.property(
'cursor.pipeline[0].$changeStream.fullDocument',
'invalid value'
);
});

it('assigns `fullDocument` to the correct value if it is passed as an option', function () {
const changeStream = client.watch([], { fullDocument: 'updateLookup' });

Expand All @@ -232,15 +241,15 @@ describe('Change Streams', function () {
);
});

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

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

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

expect(changeStream).not.to.have.nested.property(
Expand Down
11 changes: 0 additions & 11 deletions test/types/change_streams.test-d.ts

This file was deleted.

0 comments on commit 5429180

Please sign in to comment.