eng: fix selfhost test explorer not always working (#211276)

Fixes #210878
This commit is contained in:
Connor Peet 2024-04-24 10:14:25 -07:00 committed by GitHub
parent aacda1dd2f
commit ee0213f6fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -111,12 +111,14 @@ export class TestOutputScanner implements vscode.Disposable {
}
}
protected readonly processData = (data: string) => {
protected readonly processData = (data: string | Buffer) => {
if (this.args) {
this.outputEventEmitter.fire(`./scripts/test ${this.args.join(' ')}`);
this.args = undefined;
}
data = data.toString();
try {
const parsed = JSON.parse(data.trim()) as unknown;
if (parsed instanceof Array && parsed.length === 2 && typeof parsed[0] === 'string') {