From 40efd5a3f5901a9245c8dc2667df0b481778e89c Mon Sep 17 00:00:00 2001 From: Thomas Sattlecker Date: Fri, 26 Nov 2021 17:09:14 +0100 Subject: [PATCH] handle asyn and sync nature of tests --- dist/falcon/index.js | 6 +++++- falcon/index.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dist/falcon/index.js b/dist/falcon/index.js index 655f90b..8d1ff36 100644 --- a/dist/falcon/index.js +++ b/dist/falcon/index.js @@ -45,7 +45,11 @@ const test = async (param1, param2, param3) => { tempResult = { logs: '' }; tempResult.input = input; try { - await cb(input); + if (cb[Symbol.toStringTag] === 'AsyncFunction') { + await cb(input); + } else { + cb(input); + } summary.testResults.push({ title, passed: true, diff --git a/falcon/index.js b/falcon/index.js index 655f90b..8d1ff36 100644 --- a/falcon/index.js +++ b/falcon/index.js @@ -45,7 +45,11 @@ const test = async (param1, param2, param3) => { tempResult = { logs: '' }; tempResult.input = input; try { - await cb(input); + if (cb[Symbol.toStringTag] === 'AsyncFunction') { + await cb(input); + } else { + cb(input); + } summary.testResults.push({ title, passed: true,