mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
tests: added upsertAsync to test
This commit is contained in:
@@ -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({});
|
||||
|
||||
Reference in New Issue
Block a user