- fix test: 'calling find with an invalid readPreference STRING | MONGO'

This commit is contained in:
denihs
2023-02-23 17:07:42 -04:00
parent 0dda041f0c
commit 0c19c2771e
2 changed files with 4 additions and 5 deletions

View File

@@ -433,7 +433,6 @@ Object.assign(Mongo.Collection.prototype, {
* @returns {Promise<number>}
*/
countDocuments(...args) {
console.log(this._collection)
return this._collection.countDocuments(...args);
},

View File

@@ -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}"`);
}
}