@sprucelabs/data-stores 28.3.265 → 28.3.266
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.
@@ -145,7 +145,7 @@ const databaseAssertUtil = {
|
|
145
145
|
const updated = yield db.update(this.collectionName, search, updates);
|
146
146
|
assert.isEqual(updated, expectedUpdateCount, 'db.update() did not update the expected amount of records! Make sure it returns an integer of the number of records updated.');
|
147
147
|
const count = yield db.count(this.collectionName, updates);
|
148
|
-
assert.isEqual(count, expectedUpdateCount);
|
148
|
+
assert.isEqual(count, expectedUpdateCount, "db.count() did not actually update the records. I'm count()'ing the records based on a query that should match what I updated.");
|
149
149
|
});
|
150
150
|
},
|
151
151
|
assertGeneratesIdDifferentEachTime(connect) {
|
@@ -590,6 +590,7 @@ const databaseAssertUtil = {
|
|
590
590
|
const inserted = yield db.createOne(this.collectionName, {
|
591
591
|
id: db.generateId(),
|
592
592
|
name: 'first',
|
593
|
+
isPublic: true,
|
593
594
|
});
|
594
595
|
assert.isTruthy(inserted, 'createOne needs to return the record that was inserted!');
|
595
596
|
assert.isTruthy(inserted.id, `an id must be return with the record from createOne!`);
|
@@ -600,6 +601,7 @@ const databaseAssertUtil = {
|
|
600
601
|
assert.isTruthy(updated, `updateOne needs to return the record that was updated!`);
|
601
602
|
assert.isEqual(updated.id, inserted.id);
|
602
603
|
assert.isEqual(updated.name, 'updated');
|
604
|
+
assert.isEqual(updated.isPublic, true, 'Make sure you return existing fields from updateOne()! So, the actual record.');
|
603
605
|
const match = yield db.findOne(this.collectionName, { id: updated.id });
|
604
606
|
assert.isEqualDeep(match, updated, 'The record in the database did not actually update!');
|
605
607
|
yield this.shutdown(db);
|
@@ -136,7 +136,7 @@ const databaseAssertUtil = {
|
|
136
136
|
const updated = await db.update(this.collectionName, search, updates);
|
137
137
|
test_utils_1.assert.isEqual(updated, expectedUpdateCount, 'db.update() did not update the expected amount of records! Make sure it returns an integer of the number of records updated.');
|
138
138
|
const count = await db.count(this.collectionName, updates);
|
139
|
-
test_utils_1.assert.isEqual(count, expectedUpdateCount);
|
139
|
+
test_utils_1.assert.isEqual(count, expectedUpdateCount, "db.count() did not actually update the records. I'm count()'ing the records based on a query that should match what I updated.");
|
140
140
|
},
|
141
141
|
async assertGeneratesIdDifferentEachTime(connect) {
|
142
142
|
const db = await connectToDabatase(connect);
|
@@ -535,6 +535,7 @@ const databaseAssertUtil = {
|
|
535
535
|
const inserted = await db.createOne(this.collectionName, {
|
536
536
|
id: db.generateId(),
|
537
537
|
name: 'first',
|
538
|
+
isPublic: true,
|
538
539
|
});
|
539
540
|
test_utils_1.assert.isTruthy(inserted, 'createOne needs to return the record that was inserted!');
|
540
541
|
test_utils_1.assert.isTruthy(inserted.id, `an id must be return with the record from createOne!`);
|
@@ -545,6 +546,7 @@ const databaseAssertUtil = {
|
|
545
546
|
test_utils_1.assert.isTruthy(updated, `updateOne needs to return the record that was updated!`);
|
546
547
|
test_utils_1.assert.isEqual(updated.id, inserted.id);
|
547
548
|
test_utils_1.assert.isEqual(updated.name, 'updated');
|
549
|
+
test_utils_1.assert.isEqual(updated.isPublic, true, 'Make sure you return existing fields from updateOne()! So, the actual record.');
|
548
550
|
const match = await db.findOne(this.collectionName, { id: updated.id });
|
549
551
|
test_utils_1.assert.isEqualDeep(match, updated, 'The record in the database did not actually update!');
|
550
552
|
await this.shutdown(db);
|