Skip to content

Commit 3e6b100

Browse files
committed
Strip ANSI from messages during test issue output verification
1 parent dd9f67e commit 3e6b100

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/integration-tests/testexplorer/utilities.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import { TestKind } from "../../../src/TestExplorer/TestKind";
2121
import { WorkspaceContext } from "../../../src/WorkspaceContext";
2222
import { globalWorkspaceContextPromise } from "../extension.test";
2323
import { testAssetUri } from "../../fixtures";
24+
// eslint-disable-next-line @typescript-eslint/no-require-imports
25+
import stripAnsi = require("strip-ansi");
2426

2527
/**
2628
* Sets up a test that leverages the TestExplorer, returning the TestExplorer,
@@ -131,8 +133,8 @@ export function assertTestResults(
131133
.map(({ test, message }) => ({
132134
test: test.id,
133135
issues: Array.isArray(message)
134-
? message.map(({ message }) => message)
135-
: [(message as vscode.TestMessage).message],
136+
? message.map(({ message }) => stripAnsi(message.toString()))
137+
: [stripAnsi((message as vscode.TestMessage).message.toString())],
136138
}))
137139
.sort(),
138140
skipped: testRun.runState.skipped.map(({ id }) => id).sort(),

0 commit comments

Comments
 (0)