mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
- fix test: 'calling find with an invalid readPreference STRING | MONGO'
This commit is contained in:
@@ -433,7 +433,6 @@ Object.assign(Mongo.Collection.prototype, {
|
||||
* @returns {Promise<number>}
|
||||
*/
|
||||
countDocuments(...args) {
|
||||
console.log(this._collection)
|
||||
return this._collection.countDocuments(...args);
|
||||
},
|
||||
|
||||
|
||||
@@ -192,8 +192,8 @@ Tinytest.add('collection - calling find with a valid readPreference',
|
||||
}
|
||||
);
|
||||
|
||||
Tinytest.add('collection - calling find with an invalid readPreference',
|
||||
function(test) {
|
||||
Tinytest.addAsync('collection - calling find with an invalid readPreference',
|
||||
async function(test) {
|
||||
if (Meteor.isServer) {
|
||||
const invalidReadPreference = 'INVALID';
|
||||
const collection = new Mongo.Collection('readPreferenceTest2' + test.id);
|
||||
@@ -202,9 +202,9 @@ Tinytest.add('collection - calling find with an invalid readPreference',
|
||||
{ readPreference: invalidReadPreference }
|
||||
);
|
||||
|
||||
test.throws(function() {
|
||||
await test.throwsAsync(async function() {
|
||||
// Trigger the creation of _synchronousCursor
|
||||
cursor.count();
|
||||
await cursor.countAsync();
|
||||
}, `Invalid read preference mode "${invalidReadPreference}"`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user