Skip to content

Commit 3bcd393

Browse files
authored
chore: remove outdated core cursor tests (#2648)
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 a5154fb commit 3bcd393

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
@@ -33,6 +33,38 @@ describe('AbstractCursor', function () {
3333
);
3434
});
3535

36+
context('#readBufferedDocuments', function () {
37+
it(
38+
'should support reading buffered documents',
39+
withClientV2(function (client, done) {
40+
const coll = client.db().collection('abstract_cursor');
41+
const cursor = coll.find({}, { batchSize: 5 });
42+
43+
cursor.next((err, doc) => {
44+
expect(err).to.not.exist;
45+
expect(doc).property('a').to.equal(1);
46+
expect(cursor.bufferedCount()).to.equal(4);
47+
48+
// Read the buffered Count
49+
cursor.readBufferedDocuments(cursor.bufferedCount());
50+
51+
// Get the next item
52+
cursor.next((err, doc) => {
53+
expect(err).to.not.exist;
54+
expect(doc).to.exist;
55+
56+
cursor.next((err, doc) => {
57+
expect(err).to.not.exist;
58+
expect(doc).to.be.null;
59+
60+
done();
61+
});
62+
});
63+
});
64+
})
65+
);
66+
});
67+
3668
context('#close', function () {
3769
it(
3870
'should send a killCursors command when closed before completely iterated',

0 commit comments

Comments
 (0)