From 0c326b6b0cbcfe887ba6f6dcafe5631599e0d84a Mon Sep 17 00:00:00 2001 From: denihs Date: Tue, 7 Feb 2023 10:40:29 -0400 Subject: [PATCH] fix minimongo - 'minimongo - pause' --- packages/minimongo/minimongo_tests_client.js | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/minimongo/minimongo_tests_client.js b/packages/minimongo/minimongo_tests_client.js index 4ceeceb5e4..4b45273632 100644 --- a/packages/minimongo/minimongo_tests_client.js +++ b/packages/minimongo/minimongo_tests_client.js @@ -3360,43 +3360,43 @@ Tinytest.add('minimongo - objectid', test => { test.equal(randomOid, new MongoID.ObjectID(randomOid.valueOf())); }); -Tinytest.add('minimongo - pause', test => { +Tinytest.addAsync('minimongo - pause', async test => { const operations = []; const cbs = log_callbacks(operations); const c = new LocalCollection(); - const h = c.find({}).observe(cbs); + const h = await c.find({}).observe(cbs); // remove and add cancel out. - c.insert({_id: 1, a: 1}); + await c.insertAsync({_id: 1, a: 1}); test.equal(operations.shift(), ['added', {a: 1}, 0, null]); c.pauseObservers(); - c.remove({_id: 1}); + await c.removeAsync({_id: 1}); test.length(operations, 0); - c.insert({_id: 1, a: 1}); + await c.insertAsync({_id: 1, a: 1}); test.length(operations, 0); - c.resumeObservers(); + c.resumeObserversClient(); test.length(operations, 0); // two modifications become one c.pauseObservers(); - c.update({_id: 1}, {a: 2}); - c.update({_id: 1}, {a: 3}); + await c.updateAsync({_id: 1}, {a: 2}); + await c.updateAsync({_id: 1}, {a: 3}); - c.resumeObservers(); + c.resumeObserversClient(); test.equal(operations.shift(), ['changed', {a: 3}, 0, {a: 1}]); test.length(operations, 0); // test special case for remove({}) c.pauseObservers(); - test.equal(c.remove({}), 1); + test.equal(await c.removeAsync({}), 1); test.length(operations, 0); - c.resumeObservers(); + c.resumeObserversClient(); test.equal(operations.shift(), ['removed', 1, 0, {a: 3}]); test.length(operations, 0);