Skip to content

Commit

Permalink
handle asyn and sync nature of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
littleStudent committed Nov 26, 2021
1 parent 21f1bce commit 40efd5a
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 40efd5a

Please # to comment.