From 71db360c42a8cf209efa08f85316d2d2a0d9947f Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Wed, 1 Apr 2020 08:41:42 -0500 Subject: [PATCH] fix: report if there is no stack-trace --- src/nunit.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nunit.ts b/src/nunit.ts index 119a896..3fad2b4 100644 --- a/src/nunit.ts +++ b/src/nunit.ts @@ -37,7 +37,11 @@ function getLocation(stacktrace: string): [string, number] { export function testCaseAnnotation(testcase: any): Annotation | null { if (testcase.result === 'Failed') { - const [filename, lineno] = getLocation(testcase.failure['stack-trace']) + + const [filename, lineno] = + 'stack-trace' in testcase.failure + ? getLocation(testcase.failure['stack-trace']) + : ['', 0] const sanitizedFilename = filename.replace(/^\/github\/workspace\//, '') const message = testcase.failure.message