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