From 3e0371685fe16b7dc96f5f900c0d4531b16370d4 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 20 Nov 2017 16:39:34 -0600 Subject: Fix async callbacks --- packages/0x.js/test/utils/report_callback_errors.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/0x.js/test/utils') diff --git a/packages/0x.js/test/utils/report_callback_errors.ts b/packages/0x.js/test/utils/report_callback_errors.ts index d471b2af2..4f9517704 100644 --- a/packages/0x.js/test/utils/report_callback_errors.ts +++ b/packages/0x.js/test/utils/report_callback_errors.ts @@ -1,10 +1,10 @@ import { DoneCallback } from '../../src/types'; export const reportCallbackErrors = (done: DoneCallback) => { - return (f: (...args: any[]) => void) => { - const wrapped = (...args: any[]) => { + return (fAsync: (...args: any[]) => void|Promise) => { + const wrapped = async (...args: any[]) => { try { - f(...args); + await fAsync(...args); } catch (err) { done(err); } -- cgit