@sprucelabs/data-stores 28.3.269 → 28.3.271
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -295,19 +295,19 @@ const databaseAssertUtil = {
|
|
295
295
|
name: 'first',
|
296
296
|
});
|
297
297
|
assert.isTruthy(created, 'upsertOne() should return the record it created!');
|
298
|
-
assert.isEqual(created.name, 'first');
|
298
|
+
assert.isEqual(created.name, 'first', 'upsertOne() did not create the record with the name i passed');
|
299
299
|
assert.isEqual(`${created.id}`, `${id}`, 'ids do not match!');
|
300
300
|
const upserted = yield db.upsertOne(this.collectionName, { id }, { name: 'second' });
|
301
301
|
const id2 = db.generateId();
|
302
302
|
yield db.upsertOne(this.collectionName, { id: id2 }, { name: 'second', id: id2 });
|
303
|
-
assert.isTruthy(upserted);
|
304
|
-
assert.isEqual(created.id, upserted.id);
|
305
|
-
assert.isEqual(upserted.name, 'second');
|
303
|
+
assert.isTruthy(upserted, 'upsertOne() should return the record it updated!');
|
304
|
+
assert.isEqual(created.id, upserted.id, 'upsertOne() did return the expected id!');
|
305
|
+
assert.isEqual(upserted.name, 'second', 'upsertOne() did not update name!');
|
306
306
|
const upserted2 = yield db.upsertOne(this.collectionName, { id }, { name: 'third' });
|
307
307
|
assert.isTruthy(upserted2);
|
308
|
-
assert.isEqual(upserted2.name, 'third');
|
308
|
+
assert.isEqual(upserted2.name, 'third', 'upsertOne() did not update the record!');
|
309
309
|
const match = yield db.findOne(this.collectionName, { id });
|
310
|
-
assert.isEqualDeep(match, upserted2,
|
310
|
+
assert.isEqualDeep(match, upserted2, "upsertOne() did not update the record. I tried to findOne() based on my updates and it wasn't updated!");
|
311
311
|
yield this.shutdown(db);
|
312
312
|
});
|
313
313
|
},
|
@@ -603,7 +603,7 @@ const databaseAssertUtil = {
|
|
603
603
|
assert.isEqual(updated.name, 'updated', 'updateOne() did not update the fields. I tried to update the name field to "updated".');
|
604
604
|
assert.isEqual(updated.isPublic, true, 'Make sure you return existing fields from updateOne()! So, the actual record.');
|
605
605
|
const match = yield db.findOne(this.collectionName, { id: updated.id });
|
606
|
-
assert.isEqualDeep(match, updated, 'The record in the database did not actually
|
606
|
+
assert.isEqualDeep(match, Object.assign(Object.assign({}, inserted), { name: 'updated' }), 'The record in the database did not actually updated! Check that fields are not lost as well as updated.');
|
607
607
|
yield this.shutdown(db);
|
608
608
|
});
|
609
609
|
},
|
@@ -268,19 +268,19 @@ const databaseAssertUtil = {
|
|
268
268
|
name: 'first',
|
269
269
|
});
|
270
270
|
test_utils_1.assert.isTruthy(created, 'upsertOne() should return the record it created!');
|
271
|
-
test_utils_1.assert.isEqual(created.name, 'first');
|
271
|
+
test_utils_1.assert.isEqual(created.name, 'first', 'upsertOne() did not create the record with the name i passed');
|
272
272
|
test_utils_1.assert.isEqual(`${created.id}`, `${id}`, 'ids do not match!');
|
273
273
|
const upserted = await db.upsertOne(this.collectionName, { id }, { name: 'second' });
|
274
274
|
const id2 = db.generateId();
|
275
275
|
await db.upsertOne(this.collectionName, { id: id2 }, { name: 'second', id: id2 });
|
276
|
-
test_utils_1.assert.isTruthy(upserted);
|
277
|
-
test_utils_1.assert.isEqual(created.id, upserted.id);
|
278
|
-
test_utils_1.assert.isEqual(upserted.name, 'second');
|
276
|
+
test_utils_1.assert.isTruthy(upserted, 'upsertOne() should return the record it updated!');
|
277
|
+
test_utils_1.assert.isEqual(created.id, upserted.id, 'upsertOne() did return the expected id!');
|
278
|
+
test_utils_1.assert.isEqual(upserted.name, 'second', 'upsertOne() did not update name!');
|
279
279
|
const upserted2 = await db.upsertOne(this.collectionName, { id }, { name: 'third' });
|
280
280
|
test_utils_1.assert.isTruthy(upserted2);
|
281
|
-
test_utils_1.assert.isEqual(upserted2.name, 'third');
|
281
|
+
test_utils_1.assert.isEqual(upserted2.name, 'third', 'upsertOne() did not update the record!');
|
282
282
|
const match = await db.findOne(this.collectionName, { id });
|
283
|
-
test_utils_1.assert.isEqualDeep(match, upserted2,
|
283
|
+
test_utils_1.assert.isEqualDeep(match, upserted2, "upsertOne() did not update the record. I tried to findOne() based on my updates and it wasn't updated!");
|
284
284
|
await this.shutdown(db);
|
285
285
|
},
|
286
286
|
async assertCanDeleteOne(connect) {
|
@@ -548,7 +548,7 @@ const databaseAssertUtil = {
|
|
548
548
|
test_utils_1.assert.isEqual(updated.name, 'updated', 'updateOne() did not update the fields. I tried to update the name field to "updated".');
|
549
549
|
test_utils_1.assert.isEqual(updated.isPublic, true, 'Make sure you return existing fields from updateOne()! So, the actual record.');
|
550
550
|
const match = await db.findOne(this.collectionName, { id: updated.id });
|
551
|
-
test_utils_1.assert.isEqualDeep(match, updated, 'The record in the database did not actually
|
551
|
+
test_utils_1.assert.isEqualDeep(match, Object.assign(Object.assign({}, inserted), { name: 'updated' }), 'The record in the database did not actually updated! Check that fields are not lost as well as updated.');
|
552
552
|
await this.shutdown(db);
|
553
553
|
},
|
554
554
|
async assertCanSortById(connect) {
|