Skip to content

Commit 6b67f9b

Browse files
committedJan 21, 2024
test: add test case for #14184
1 parent 900e9fa commit 6b67f9b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎test/collection.test.js

+13
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ describe('collections:', function() {
6868
});
6969
});
7070

71+
it('returns a promise if buffering and callback with find() (gh-14184)', function(done) {
72+
db = mongoose.createConnection();
73+
const collection = db.collection('gh14184');
74+
collection.opts.bufferTimeoutMS = 100;
75+
76+
collection.find({ foo: 'bar' }, {}, (err, docs) => {
77+
assert.ok(err);
78+
assert.ok(err.message.includes('buffering timed out after 100ms'));
79+
assert.equal(docs, undefined);
80+
done();
81+
});
82+
});
83+
7184
it('methods should that throw (unimplemented)', function() {
7285
const collection = new Collection('test', mongoose.connection);
7386
let thrown = false;

0 commit comments

Comments
 (0)
Please sign in to comment.