Skip to content

Commit

Permalink
chore(e2e): check for undefined code before printing fail (react-nati…
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee committed Aug 19, 2023
1 parent 1b97b1b commit 2204d35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jest/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ function handleTestFailure(
result: {[key: string]: any},
args: string[] | undefined,
) {
if (!options.expectedFailure && result.code !== 0) {
if (
!options.expectedFailure &&
result.code !== undefined &&
result.code !== 0
) {
console.log(`Running ${cmd} command failed for unexpected reason. Here's more info:
${chalk.bold('cmd:')} ${cmd}
${chalk.bold('options:')} ${JSON.stringify(options)}
Expand Down

0 comments on commit 2204d35

Please sign in to comment.