Unseal envelope in a separate step for better logs

This commit is contained in:
Fedor Indutny 2021-08-02 14:11:18 -07:00 committed by Scott Nonnenberg
parent 907e1d32ec
commit 21ffb7c054
3 changed files with 110 additions and 73 deletions

View file

@ -44,4 +44,12 @@ describe('createTaskWithTimeout', () => {
});
await assert.isRejected(taskWithTimeout(), 'Task is throwing!');
});
it('passes arguments to the underlying function', async () => {
const task = (arg: string) => Promise.resolve(arg);
const taskWithTimeout = createTaskWithTimeout(task, 'test');
const result = await taskWithTimeout('hi!');
assert.strictEqual(result, 'hi!');
});
});