diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index d9d08649263f70b9335cded00d95c39ff849ded0..37296cad74bbb16025d802dcc741bf2c7af26ead 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -14093,6 +14093,17 @@ declare module 'vscode' { */ failed(test: TestItem, message: TestMessage | readonly TestMessage[], duration?: number): void; + /** + * Indicates a test has errored. You should pass one or more + * {@link TestMessage | TestMessages} to describe the failure. This differs + * from the "failed" state in that it indicates a test that couldn't be + * executed at all, from a compilation error for example. + * @param test Test item to update. + * @param messages Messages associated with the test failure. + * @param duration How long the test took to execute, in milliseconds. + */ + errored(test: TestItem, message: TestMessage | readonly TestMessage[], duration?: number): void; + /** * Indicates a test has passed. * @param test Test item to update. diff --git a/src/vs/workbench/api/common/extHostTesting.ts b/src/vs/workbench/api/common/extHostTesting.ts index 53ba452ec3710f5e965ec63354742352a281a41e..0df698b2576cfbccec194b45e50e91e5f2d3f9d9 100644 --- a/src/vs/workbench/api/common/extHostTesting.ts +++ b/src/vs/workbench/api/common/extHostTesting.ts @@ -355,6 +355,11 @@ class TestRunTracker extends Disposable { started: guardTestMutation(test => { this.proxy.$updateTestStateInRun(runId, taskId, TestId.fromExtHostTestItem(test, ctrlId).toString(), TestResultState.Running); }), + errored: guardTestMutation((test, messages, duration) => { + this.proxy.$appendTestMessagesInRun(runId, taskId, TestId.fromExtHostTestItem(test, ctrlId).toString(), + messages instanceof Array ? messages.map(Convert.TestMessage.from) : [Convert.TestMessage.from(messages)]); + this.proxy.$updateTestStateInRun(runId, taskId, TestId.fromExtHostTestItem(test, ctrlId).toString(), TestResultState.Errored, duration); + }), failed: guardTestMutation((test, messages, duration) => { this.proxy.$appendTestMessagesInRun(runId, taskId, TestId.fromExtHostTestItem(test, ctrlId).toString(), messages instanceof Array ? messages.map(Convert.TestMessage.from) : [Convert.TestMessage.from(messages)]);