Module: apps/cursorless-vscode-e2e/asyncSafety
Functions
asyncSafety
▸ asyncSafety(fn
): (done
: Done
) => void
if an async returns after the method times out, it will cause a "done() called multiple times" error. In the context of a running webdriver, this is potentially very bad. We need to be able to quit the driver gracefully under any circumstances. This allows methods to time out while an async is pending, and will avoid calling done twice in this case.
From https://github.com/mochajs/mocha/issues/967#issuecomment-810484206
Parameters
Name | Type | Description |
---|---|---|
fn | () => Promise <void > | The test function to run |
Returns
fn
A safely wrapped test function
▸ (done
): void
Parameters
Name | Type |
---|---|
done | Done |
Returns
void
Defined in
apps/cursorless-vscode-e2e/asyncSafety.ts:15