Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Commit

Permalink
fix: report if there is no stack-trace
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Apr 7, 2020
1 parent de46e58 commit 71db360
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/nunit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71db360

Please sign in to comment.