From e1ca68d4d691ecdfbb9e136614750cc7cdccae6a Mon Sep 17 00:00:00 2001 From: denihs Date: Thu, 16 Feb 2023 09:17:06 -0400 Subject: [PATCH] - fix test: ''collection - partial allow, STRING | MONGO' --- packages/mongo/allow_tests.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/packages/mongo/allow_tests.js b/packages/mongo/allow_tests.js index d5f06f5155..dfc5aae3fc 100644 --- a/packages/mongo/allow_tests.js +++ b/packages/mongo/allow_tests.js @@ -278,13 +278,20 @@ if (Meteor.isClient) { // test that if allow is called once then the collection is // restricted, and that other mutations aren't allowed - testAsyncMulti("collection - partial allow, " + idGeneration, [ - function (test, expect) { - restrictedCollectionForPartialAllowTest.update( - 'foo', {$set: {updated: true}}, expect(function (err, res) { - test.equal(err.error, 403); - })); - } + testAsyncMulti('collection - partial allow, ' + idGeneration, [ + async function(test, expect) { + try { + await restrictedCollectionForPartialAllowTest.updateAsync( + 'foo', + { $set: { updated: true } }, + { + returnServerResultPromise: true, + } + ); + } catch (err) { + test.equal(err.error, 403); + } + }, ]); // test that if deny is called once then the collection is