From 0c19c2771e1546b6ccbd1d8b7c1712c2de61865e Mon Sep 17 00:00:00 2001 From: denihs Date: Thu, 23 Feb 2023 17:07:42 -0400 Subject: [PATCH] - fix test: 'calling find with an invalid readPreference STRING | MONGO' --- packages/mongo/collection.js | 1 - packages/mongo/collection_tests.js | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/mongo/collection.js b/packages/mongo/collection.js index e6f0983e31..b54fe0aa7e 100644 --- a/packages/mongo/collection.js +++ b/packages/mongo/collection.js @@ -433,7 +433,6 @@ Object.assign(Mongo.Collection.prototype, { * @returns {Promise} */ countDocuments(...args) { - console.log(this._collection) return this._collection.countDocuments(...args); }, diff --git a/packages/mongo/collection_tests.js b/packages/mongo/collection_tests.js index 6211926728..9474d84ce8 100644 --- a/packages/mongo/collection_tests.js +++ b/packages/mongo/collection_tests.js @@ -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}"`); } }