From d6b59d80e707c70bf5cd329e0c9aa95499a14610 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Thu, 25 May 2023 08:29:18 -0500 Subject: [PATCH] fix: stacktrace can by null (is typed wrong) --- src/formatters/deployResultFormatter.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/formatters/deployResultFormatter.ts b/src/formatters/deployResultFormatter.ts index ab1fed45..7d9b04c1 100644 --- a/src/formatters/deployResultFormatter.ts +++ b/src/formatters/deployResultFormatter.ts @@ -314,10 +314,12 @@ export class DeployResultFormatter implements Formatter { ux.log(error(`Test Failures [${failureCount}]`)); for (const test of testFailures) { const testName = underline(`${test.name}.${test.methodName}`); - const stackTrace = test.stackTrace.replace(/\n/g, `${os.EOL} `); ux.log(`• ${testName}`); ux.log(` ${dim('message')}: ${test.message}`); - ux.log(` ${dim('stacktrace')}: ${os.EOL} ${stackTrace}`); + if (test.stackTrace) { + const stackTrace = test.stackTrace.replace(/\n/g, `${os.EOL} `); + ux.log(` ${dim('stacktrace')}: ${os.EOL} ${stackTrace}`); + } ux.log(); } }