From f34a96fe18e2ab31e5fcb582ab4353f86bd014fe Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 15 Jan 2024 13:12:46 -0300 Subject: [PATCH] added tests --- packages/minimongo/minimongo_tests_client.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/minimongo/minimongo_tests_client.js b/packages/minimongo/minimongo_tests_client.js index fd14e99fa4..2546316119 100644 --- a/packages/minimongo/minimongo_tests_client.js +++ b/packages/minimongo/minimongo_tests_client.js @@ -212,6 +212,21 @@ Tinytest.addAsync('minimongo - basics', async test => { test.equal(after.d, undefined); }); + +Tinytest.addAsync('minimongo - upsert', async test => { + const c = new LocalCollection(); + + await c.upsertAsync({ name: 'doc' }, { name: 'doc' }); + + test.equal(c.find({}).count(), 1); + + await c.removeAsync({}); + + c.upsert({ name: 'doc' }, { name: 'doc' }); + test.equal(c.find({}).count(), 1); +}); + + Tinytest.add('minimongo - error - no options', test => { try { throw MinimongoError('Not fun to have errors');