@sprucelabs/data-stores 28.3.262 → 28.3.264
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
|
});
|
@@ -535,7 +537,7 @@ const databaseAssertUtil = {
|
|
535
537
|
const results = yield db.create(this.collectionName, values);
|
536
538
|
assert.isLength(results, values.length);
|
537
539
|
for (const val of values) {
|
538
|
-
assert.doesInclude(results, val);
|
540
|
+
assert.doesInclude(results, val, 'Create many did not return the expected records!');
|
539
541
|
}
|
540
542
|
yield this.shutdown(db);
|
541
543
|
});
|
@@ -1946,7 +1948,7 @@ const databaseAssertUtil = {
|
|
1946
1948
|
const matches = yield db.find(this.collectionName, {
|
1947
1949
|
$or,
|
1948
1950
|
});
|
1949
|
-
assert.isLength(matches, expected);
|
1951
|
+
assert.isLength(matches, expected, `Expected to find a specific number of records using $or: ${JSON.stringify($or)}`);
|
1950
1952
|
});
|
1951
1953
|
},
|
1952
1954
|
_assertCanCreateMultiFieldIndex(connect, fields) {
|
@@ -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
|
},
|
@@ -486,7 +488,7 @@ const databaseAssertUtil = {
|
|
486
488
|
const results = await db.create(this.collectionName, values);
|
487
489
|
test_utils_1.assert.isLength(results, values.length);
|
488
490
|
for (const val of values) {
|
489
|
-
test_utils_1.assert.doesInclude(results, val);
|
491
|
+
test_utils_1.assert.doesInclude(results, val, 'Create many did not return the expected records!');
|
490
492
|
}
|
491
493
|
await this.shutdown(db);
|
492
494
|
},
|
@@ -1789,7 +1791,7 @@ const databaseAssertUtil = {
|
|
1789
1791
|
const matches = await db.find(this.collectionName, {
|
1790
1792
|
$or,
|
1791
1793
|
});
|
1792
|
-
test_utils_1.assert.isLength(matches, expected);
|
1794
|
+
test_utils_1.assert.isLength(matches, expected, `Expected to find a specific number of records using $or: ${JSON.stringify($or)}`);
|
1793
1795
|
},
|
1794
1796
|
async _assertCanCreateMultiFieldIndex(connect, fields) {
|
1795
1797
|
const db = await connectToDabatase(connect);
|