diff --git a/extensions/ql-vscode/src/cli.ts b/extensions/ql-vscode/src/cli.ts index fb7155e2d..189f5cca1 100644 --- a/extensions/ql-vscode/src/cli.ts +++ b/extensions/ql-vscode/src/cli.ts @@ -104,6 +104,7 @@ export interface TestCompleted { evaluationMs: number; expected: string; diff: string[] | undefined; + failureDescription?: string; } /** diff --git a/extensions/ql-vscode/src/test-adapter.ts b/extensions/ql-vscode/src/test-adapter.ts index e0f94a16f..44f33c90d 100644 --- a/extensions/ql-vscode/src/test-adapter.ts +++ b/extensions/ql-vscode/src/test-adapter.ts @@ -223,8 +223,8 @@ export class QLTestAdapter extends DisposableObject implements TestAdapter { ? 'errored' : 'failed'; let message: string | undefined; - if (event.diff?.length) { - message = ['', `${state}: ${event.test}`, ...event.diff, ''].join('\n'); + if (event.failureDescription || event.diff?.length) { + message = ['', `${state}: ${event.test}`, event.failureDescription || event.diff?.join('\n'), ''].join('\n'); testLogger.log(message); } this._testStates.fire({