Skip to content

Commit

Permalink
Report description for test failure when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardopirovano committed Mar 18, 2021
1 parent 10e86f1 commit 74006b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions extensions/ql-vscode/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export interface TestCompleted {
evaluationMs: number;
expected: string;
diff: string[] | undefined;
failureDescription?: string;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions extensions/ql-vscode/src/test-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 74006b2

Please sign in to comment.