diff --git a/packages/test-helpers/async_multi.js b/packages/test-helpers/async_multi.js index 1f5d001e25..ef7b155124 100644 --- a/packages/test-helpers/async_multi.js +++ b/packages/test-helpers/async_multi.js @@ -139,16 +139,18 @@ testAsyncMulti = function (name, funcs) { }, timeout); test.extraDetails.asyncBlock = i++; - try { - func.apply(context, [test, _.bind(em.expect, em)]); - } catch (exception) { - if (em.cancel()) + + new Promise(resolve => { + resolve(func.apply(context, [test, _.bind(em.expect, em)])); + }).then(result => { + em.done(); + }, exception => { + if (em.cancel()) { test.exception(exception); + // Because we called test.exception, we're not to call onComplete. + } Meteor.clearTimeout(timer); - // Because we called test.exception, we're not to call onComplete. - return; - } - em.done(); + }); } };