diff options
author | Leonid <logvinov.leon@gmail.com> | 2018-01-13 07:51:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-13 07:51:23 +0800 |
commit | a95049450346459c5e6a211464e94fc4f702cebb (patch) | |
tree | 2cff4f477fd145f4eac897bc19d7dc0a3aecf723 /packages/0x.js/test/utils | |
parent | 80a46d14beec7544849247f9362db3de3bae04a8 (diff) | |
parent | 6a56f209289105d7641c547a702469cbc9259029 (diff) | |
download | dexon-sol-tools-a95049450346459c5e6a211464e94fc4f702cebb.tar dexon-sol-tools-a95049450346459c5e6a211464e94fc4f702cebb.tar.gz dexon-sol-tools-a95049450346459c5e6a211464e94fc4f702cebb.tar.bz2 dexon-sol-tools-a95049450346459c5e6a211464e94fc4f702cebb.tar.lz dexon-sol-tools-a95049450346459c5e6a211464e94fc4f702cebb.tar.xz dexon-sol-tools-a95049450346459c5e6a211464e94fc4f702cebb.tar.zst dexon-sol-tools-a95049450346459c5e6a211464e94fc4f702cebb.zip |
Merge pull request #312 from 0xProject/feature/error-reporting-intervals
Better error handling on async/sync intervals
Diffstat (limited to 'packages/0x.js/test/utils')
-rw-r--r-- | packages/0x.js/test/utils/report_callback_errors.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/0x.js/test/utils/report_callback_errors.ts b/packages/0x.js/test/utils/report_callback_errors.ts index a7d9e61be..27c9745c9 100644 --- a/packages/0x.js/test/utils/report_callback_errors.ts +++ b/packages/0x.js/test/utils/report_callback_errors.ts @@ -25,7 +25,7 @@ export const reportNoErrorCallbackErrors = (done: DoneCallback, expectToBeCalled }; }; -export const reportNodeCallbackErrors = (done: DoneCallback) => { +export const reportNodeCallbackErrors = (done: DoneCallback, expectToBeCalledOnce = true) => { return <T>(f?: (value: T) => void) => { const wrapped = (error: Error | null, value: T | undefined) => { if (!_.isNull(error)) { @@ -37,7 +37,9 @@ export const reportNodeCallbackErrors = (done: DoneCallback) => { } try { f(value as T); - done(); + if (expectToBeCalledOnce) { + done(); + } } catch (err) { done(err); } |