Skip to content

Commit 72266ae

Browse files
committed
Split captured output
1 parent 715ac69 commit 72266ae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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)