Skip to content

Commit 2204d35

Browse files
authored
chore(e2e): check for undefined code before printing fail (#2061)
1 parent 1b97b1b commit 2204d35

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jest/helpers.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,11 @@ function handleTestFailure(
194194
result: {[key: string]: any},
195195
args: string[] | undefined,
196196
) {
197-
if (!options.expectedFailure && result.code !== 0) {
197+
if (
198+
!options.expectedFailure &&
199+
result.code !== undefined &&
200+
result.code !== 0
201+
) {
198202
console.log(`Running ${cmd} command failed for unexpected reason. Here's more info:
199203
${chalk.bold('cmd:')} ${cmd}
200204
${chalk.bold('options:')} ${JSON.stringify(options)}

0 commit comments

Comments
 (0)