Skip to content

Commit

Permalink
fix: Use <br> to break lines in test message (#1345)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo authored Dec 14, 2021
1 parent 0a23541 commit 65639c0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"aiKey": "90c182a8-8dab-45d4-bfb8-1353eb55aa7f",
"engines": {
"vscode": "^1.61.0"
"vscode": "^1.63.0"
},
"categories": [
"Testing"
Expand Down Expand Up @@ -424,7 +424,7 @@
"@types/mocha": "^9.0.0",
"@types/node": "^14.14.33",
"@types/sinon": "^10.0.6",
"@types/vscode": "1.61.0",
"@types/vscode": "1.63.0",
"glob": "^7.2.0",
"mocha": "^9.1.2",
"sinon": "^11.1.2",
Expand Down
1 change: 1 addition & 0 deletions src/controller/testController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ async function getIncludedItems(request: TestRunRequest, token?: CancellationTok
}
removeTestInvocations(testItems);
testItems = await expandTests(testItems, TestLevel.Class, token);
// @ts-expect-error
const excludingItems: TestItem[] = await expandTests(request.exclude || [], TestLevel.Class, token);
testItems = _.differenceBy(testItems, excludingItems, 'id');
return testItems;
Expand Down
6 changes: 3 additions & 3 deletions src/runners/baseRunner/RunnerResultAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export abstract class RunnerResultAnalyzer {
}
}
} else {
// in case the message contains message like: 'expected: <..> but was: <..>'
traces.appendText(data.replace(/</g, '&lt;').replace(/>/g, '&gt;'));
// '<' & '>' will be escaped when displaying the test message, so replacing them to '[' & ']'.
traces.appendText(data.replace(/</g, '[').replace(/>/g, ']'));
}
traces.appendText('\n');
traces.appendMarkdown('<br/>');
}
}
1 change: 1 addition & 0 deletions src/runners/junitRunner/JUnitRunnerResultAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export class JUnitRunnerResultAnalyzer extends RunnerResultAnalyzer {
} else if (data.startsWith(MessageId.TraceStart)) {
this.traces = new MarkdownString();
this.traces.isTrusted = true;
this.traces.supportHtml = true;
this.recordingType = RecordingType.StackTrace;
} else if (data.startsWith(MessageId.TraceEnd)) {
if (!this.currentItem) {
Expand Down

0 comments on commit 65639c0

Please sign in to comment.