Skip to content

Commit 4bfd449

Browse files
committed
chore: remove outdated core cursor tests
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
1 parent 98ae02c commit 4bfd449

File tree

2 files changed

+32
-382
lines changed

2 files changed

+32
-382
lines changed

test/functional/abstract_cursor.test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,38 @@ describe('AbstractCursor', function () {
4949
);
5050
});
5151

52+
context('#readBufferedDocuments', function () {
53+
it(
54+
'should support reading buffered documents',
55+
withClientV2(function (client, done) {
56+
const coll = client.db().collection('abstract_cursor');
57+
const cursor = coll.find({}, { batchSize: 5 });
58+
59+
cursor.next((err, doc) => {
60+
expect(err).to.not.exist;
61+
expect(doc).property('a').to.equal(1);
62+
expect(cursor.bufferedCount()).to.equal(4);
63+
64+
// Read the buffered Count
65+
cursor.readBufferedDocuments(cursor.bufferedCount());
66+
67+
// Get the next item
68+
cursor.next((err, doc) => {
69+
expect(err).to.not.exist;
70+
expect(doc).to.exist;
71+
72+
cursor.next((err, doc) => {
73+
expect(err).to.not.exist;
74+
expect(doc).to.be.null;
75+
76+
done();
77+
});
78+
});
79+
});
80+
})
81+
);
82+
});
83+
5284
context('#close', function () {
5385
it(
5486
'should send a killCursors command when closed before completely iterated',

0 commit comments

Comments
 (0)