From 990dcc05d96c34bfa8c7843ba5224fc405839a3a Mon Sep 17 00:00:00 2001 From: Klaas Pieter Annema Date: Thu, 6 Feb 2025 16:54:36 +0100 Subject: [PATCH] Append test output when a test fails When a test fails `assertTestPasses` throws an error with the stdout of the command. This wasn't added to the test's output in the `catch` handler which made VSCode report the test run as not recording any output. Fixes #3090 --- vscode/src/testController.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vscode/src/testController.ts b/vscode/src/testController.ts index d4c7112ea..57b238916 100644 --- a/vscode/src/testController.ts +++ b/vscode/src/testController.ts @@ -279,6 +279,12 @@ export class TestController { run.appendOutput(output.replace(/\r?\n/g, "\r\n"), undefined, test); run.passed(test, Date.now() - start); } catch (err: any) { + run.appendOutput( + err.message.replace(/\r?\n/g, "\r\n"), + undefined, + test, + ); + const duration = Date.now() - start; if (err.killed) {