perf: convert promise.all to single query (#9851)

This commit is contained in:
Barış Soner Uşaklı
2021-10-01 15:24:19 -04:00
committed by GitHub
parent 7d1c7e0a7b
commit ea04aeded4
2 changed files with 67 additions and 21 deletions

View File

@@ -90,6 +90,13 @@ describe('Hash methods', () => {
assert.deepStrictEqual(result, [{ foo: '1' }, null]);
});
it('should update existing object on second call', async () => {
await db.setObjectBulk(['bulkKey3.5'], [{ foo: '1' }]);
await db.setObjectBulk(['bulkKey3.5'], [{ baz: '2' }]);
const result = await db.getObject('bulkKey3.5');
assert.deepStrictEqual(result, { foo: '1', baz: '2' });
});
it('should not error if object is empty', async () => {
const keys = ['bulkKey5'];
const data = [{ }];