From 3fbf16e37cee5345dc1a65df9d4d8500cbbaec0b Mon Sep 17 00:00:00 2001 From: denihs Date: Thu, 16 Feb 2023 14:55:16 -0400 Subject: [PATCH] - fix test: ''collection - locked down, STRING | MONGO' --- packages/mongo/allow_tests.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/mongo/allow_tests.js b/packages/mongo/allow_tests.js index 05ec6a8423..fe37bf6b7a 100644 --- a/packages/mongo/allow_tests.js +++ b/packages/mongo/allow_tests.js @@ -546,18 +546,19 @@ if (Meteor.isClient) { }, ]); - testAsyncMulti("collection - locked down, " + idGeneration, [ - function (test, expect) { - lockedDownCollection.callClearMethod(expect(function() { - test.equal(lockedDownCollection.find().count(), 0); - })); + testAsyncMulti('collection - locked down, ' + idGeneration, [ + async function(test, expect) { + await lockedDownCollection.callClearMethod(); + test.equal(await lockedDownCollection.find().countAsync(), 0); + }, + async function(test, expect) { + await lockedDownCollection + .insertAsync({ foo: 'bar' }) + .catch(async function(err, res) { + test.equal(err.error, 403); + test.equal(await lockedDownCollection.find().countAsync(), 0); + }); }, - function (test, expect) { - lockedDownCollection.insert({foo: 'bar'}, expect(function (err, res) { - test.equal(err.error, 403); - test.equal(lockedDownCollection.find().count(), 0); - })); - } ]); (function () {