@sprucelabs/data-stores 28.3.263 → 28.3.265
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.
@@ -468,9 +468,11 @@ const databaseAssertUtil = {
|
|
468
468
|
catch (_a) {
|
469
469
|
assert.fail('createOne() tried to create a record with an object field. Make sure the target field handles objects!');
|
470
470
|
}
|
471
|
+
assert.isTruthy(created, 'createOne() did not return the record created!');
|
471
472
|
const matched = yield db.findOne(this.collectionName, {
|
472
473
|
id: created.id,
|
473
474
|
});
|
475
|
+
assert.isTruthy(matched, `findOne() with id ${created.id} returned null`);
|
474
476
|
assert.isEqualDeep(matched, Object.assign(Object.assign({}, created), { id: matched.id }));
|
475
477
|
yield this.shutdown(db);
|
476
478
|
});
|
@@ -598,6 +600,8 @@ const databaseAssertUtil = {
|
|
598
600
|
assert.isTruthy(updated, `updateOne needs to return the record that was updated!`);
|
599
601
|
assert.isEqual(updated.id, inserted.id);
|
600
602
|
assert.isEqual(updated.name, 'updated');
|
603
|
+
const match = yield db.findOne(this.collectionName, { id: updated.id });
|
604
|
+
assert.isEqualDeep(match, updated, 'The record in the database did not actually update!');
|
601
605
|
yield this.shutdown(db);
|
602
606
|
});
|
603
607
|
},
|
@@ -425,9 +425,11 @@ const databaseAssertUtil = {
|
|
425
425
|
catch (_a) {
|
426
426
|
test_utils_1.assert.fail('createOne() tried to create a record with an object field. Make sure the target field handles objects!');
|
427
427
|
}
|
428
|
+
test_utils_1.assert.isTruthy(created, 'createOne() did not return the record created!');
|
428
429
|
const matched = await db.findOne(this.collectionName, {
|
429
430
|
id: created.id,
|
430
431
|
});
|
432
|
+
test_utils_1.assert.isTruthy(matched, `findOne() with id ${created.id} returned null`);
|
431
433
|
test_utils_1.assert.isEqualDeep(matched, Object.assign(Object.assign({}, created), { id: matched.id }));
|
432
434
|
await this.shutdown(db);
|
433
435
|
},
|
@@ -543,6 +545,8 @@ const databaseAssertUtil = {
|
|
543
545
|
test_utils_1.assert.isTruthy(updated, `updateOne needs to return the record that was updated!`);
|
544
546
|
test_utils_1.assert.isEqual(updated.id, inserted.id);
|
545
547
|
test_utils_1.assert.isEqual(updated.name, 'updated');
|
548
|
+
const match = await db.findOne(this.collectionName, { id: updated.id });
|
549
|
+
test_utils_1.assert.isEqualDeep(match, updated, 'The record in the database did not actually update!');
|
546
550
|
await this.shutdown(db);
|
547
551
|
},
|
548
552
|
async assertCanSortById(connect) {
|