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(); } }