Skip to content

Commit

Permalink
Merge pull request #28 from getmimo/handle-async-and-sync-nature-of-t…
Browse files Browse the repository at this point in the history
…ests

handle asyn and sync nature of tests
  • Loading branch information
littleStudent authored Nov 29, 2021
2 parents 21f1bce + 40efd5a commit 880ee34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion dist/falcon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion falcon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 880ee34

Please # to comment.