Skip to content

Commit cf3432a

Browse files
committed
Split captured output
1 parent 715ac69 commit cf3432a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/TestExplorer/TestParsers/SwiftTestingOutputParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export class SwiftTestingOutputParser {
211211

212212
rl.on("line", line => this.parse(JSON.parse(line), runState));
213213

214-
await reader.start(readlinePipe);
214+
void reader.start(readlinePipe);
215215
}
216216

217217
/**

test/integration-tests/testexplorer/TestExplorerIntegration.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { Commands } from "../../../src/commands";
5050
import { executeTaskAndWaitForResult } from "../../utilities/tasks";
5151
import { createBuildAllTask } from "../../../src/tasks/SwiftTaskProvider";
5252
import { FolderContext } from "../../../src/FolderContext";
53+
import { lineBreakRegex } from "../../../src/utilities/tasks";
5354

5455
suite("Test Explorer Suite", function () {
5556
const MAX_TEST_RUN_TIME_MINUTES = 5;
@@ -261,9 +262,12 @@ suite("Test Explorer Suite", function () {
261262
// in the middle of the print, so the last line is actually end end of our
262263
// huge string. If they fix this in future this `find` ensures the test wont break.
263264
const needle = "100000";
264-
const lastTenLines = testRun.runState.output.slice(-10).join("\n");
265+
const output = testRun.runState.output.flatMap(o =>
266+
o.split(lineBreakRegex).filter(o => !!o)
267+
);
268+
const lastTenLines = output.slice(-10).join("\n");
265269
assertContainsTrimmed(
266-
testRun.runState.output,
270+
output,
267271
needle,
268272
`Expected all test output to be captured, but it was truncated. Last 10 lines of output were: ${lastTenLines}`
269273
);

0 commit comments

Comments
 (0)