File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/TestExplorer/TestParsers Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1515import { ITestRunState , TestIssueDiff } from "./TestRunState" ;
1616import { sourceLocationToVSCodeLocation } from "../../utilities/utilities" ;
1717import { MarkdownString , Location } from "vscode" ;
18+ // eslint-disable-next-line @typescript-eslint/no-require-imports
19+ import stripAnsi = require( "strip-ansi" ) ;
1820
1921/** Regex for parsing XCTest output */
2022interface TestRegex {
@@ -148,7 +150,10 @@ export class XCTestOutputParser implements IXCTestOutputParser {
148150 * Parse results from `swift test` and update tests accordingly
149151 * @param output Output from `swift test`
150152 */
151- public parseResult ( output : string , runState : ITestRunState ) {
153+ public parseResult ( rawOutput : string , runState : ITestRunState ) {
154+ // Windows is inserting ANSI codes into the output to do things like clear the cursor,
155+ // which we don't care about.
156+ const output = process . platform === "win32" ? stripAnsi ( rawOutput ) : rawOutput ;
152157 const output2 = output . replace ( / \r \n / g, "\n" ) ;
153158 const lines = output2 . split ( "\n" ) ;
154159 if ( runState . excess ) {
You can’t perform that action at this time.
0 commit comments