refactor: remove legacy callbacks from bulk storage

This commit is contained in:
Rainer Killinger
2021-04-26 18:32:31 +02:00
parent 7424ad9831
commit 334f5a7507
6 changed files with 18 additions and 18 deletions

View File

@@ -81,14 +81,14 @@ describe('Bulk Storage', function () {
});
it('should throw an error if the bulk for deletion cannot be read', async function () {
sandbox.stub(BulkStorage.prototype, 'read').callsFake(async () => Promise.resolve(undefined));
sandbox.stub(BulkStorage.prototype, 'read').callsFake(() => undefined);
const bulkStorage = new BulkStorage(database);
return expect(bulkStorage.delete('123')).to.be.rejected;
});
it('should delete a bulk', async function () {
const readStub = sandbox.stub(BulkStorage.prototype, 'read').callsFake(async () => Promise.resolve(bulk));
const readStub = sandbox.stub(BulkStorage.prototype, 'read').callsFake(() => bulk);
let caught: any;
sandbox.stub(NodeCache.prototype, 'del').callsFake(() => caught = 123);
// force call