File tree Expand file tree Collapse file tree
packages/extension/src/Observers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,14 +94,18 @@ export class PrinterObserver implements TestRunnerObserver {
9494 return ;
9595 }
9696
97- const testId = result && 'id' in result ? result . id : undefined ;
98- const location =
99- result && 'file' in result
100- ? this . toLocation (
101- result as TestResultIdentify & { details ?: TestFailed [ 'details' ] } ,
102- )
103- : undefined ;
104- this . append ( output , location , testId ) ;
97+ if ( ! result || ! this . isIdentifiable ( result ) ) {
98+ this . append ( output ) ;
99+ return ;
100+ }
101+
102+ this . append ( output , this . toLocation ( result ) , result . id ) ;
103+ }
104+
105+ private isIdentifiable (
106+ result : TestResult ,
107+ ) : result is TestResult & TestResultIdentify & { details ?: TestFailed [ 'details' ] } {
108+ return 'id' in result && 'file' in result ;
105109 }
106110
107111 private toLocation (
You can’t perform that action at this time.
0 commit comments