Skip to content

Commit

Permalink
chore: remove outdated core cursor tests (#2648)
Browse files Browse the repository at this point in the history
This removes the cursor tests migrated from the core/native merger,
any test which was not already covered by the `AbstractCursor`
tests was migrated.

NODE-2812
  • Loading branch information
mbroadst committed Dec 2, 2020
1 parent a5154fb commit 3bcd393
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 382 deletions.
32 changes: 32 additions & 0 deletions test/functional/abstract_cursor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,38 @@ describe('AbstractCursor', function () {
);
});

context('#readBufferedDocuments', function () {
it(
'should support reading buffered documents',
withClientV2(function (client, done) {
const coll = client.db().collection('abstract_cursor');
const cursor = coll.find({}, { batchSize: 5 });

cursor.next((err, doc) => {
expect(err).to.not.exist;
expect(doc).property('a').to.equal(1);
expect(cursor.bufferedCount()).to.equal(4);

// Read the buffered Count
cursor.readBufferedDocuments(cursor.bufferedCount());

// Get the next item
cursor.next((err, doc) => {
expect(err).to.not.exist;
expect(doc).to.exist;

cursor.next((err, doc) => {
expect(err).to.not.exist;
expect(doc).to.be.null;

done();
});
});
});
})
);
});

context('#close', function () {
it(
'should send a killCursors command when closed before completely iterated',
Expand Down

0 comments on commit 3bcd393

Please sign in to comment.