From 59d5cd3cf85df1d2c4dc722c080634503cccd91c Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Wed, 17 May 2023 15:06:19 -0300 Subject: [PATCH] tests: added upsertAsync to test --- packages/mongo/collection_tests.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/mongo/collection_tests.js b/packages/mongo/collection_tests.js index c38e6a617a..6d2b835332 100644 --- a/packages/mongo/collection_tests.js +++ b/packages/mongo/collection_tests.js @@ -449,8 +449,9 @@ Tinytest.addAsync('collection - should not block on cursor mismatch (#12516)', Meteor.isServer && Tinytest.addAsync('collection - simple add', async function(test){ var collectionName = 'add' + test.id; var collection = new Mongo.Collection(collectionName); - var id = await collection.insert({a: 1}); + var id = await collection.insertAsync({a: 1}); test.equal((await collection.findOneAsync(id)).a, 1); + collection.upsertAsync(id, {$set: {a: 2}}); id = await collection.insertAsync({a: 2}); test.equal((await collection.findOneAsync(id)).a, 2); await collection.removeAsync({});