Skip to content

Commit 1f8c708

Browse files
committed
fix print output
1 parent 36140d0 commit 1f8c708

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "PHPUnit Test Explorer",
55
"icon": "img/icon.png",
66
"publisher": "recca0120",
7-
"version": "3.5.35",
7+
"version": "3.5.36",
88
"private": true,
99
"license": "MIT",
1010
"repository": {

src/Observers/Printers/Printer.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,13 @@ export abstract class Printer {
124124

125125
const name = 'name' in result ? result.name : '';
126126
const message = 'message' in result ? result.message : '';
127-
const matched = message.match(/This\stest\sprinted\soutput:(.*)/);
128-
const text = !matched ? this.outputBuffer.get(name) : matched[1].trim();
127+
128+
const pattern = [
129+
'This test printed output',
130+
'Test code or tested code printed unexpected output',
131+
].join('|');
132+
const matched = message.match(new RegExp(`(${pattern}):(?<output>.*)`, 'i'));
133+
const text = !matched ? this.outputBuffer.get(name) : matched?.groups!.output.trim();
129134

130135
return text ? `${icon} ${text}` : undefined;
131136
}

0 commit comments

Comments
 (0)