Skip to content

Commit db9bc91

Browse files
Merge pull request #103 from salesforcecli/cd/test-result-strip-ansi
fix: strip ANSI escape codes from test results W-17919369
2 parents 710d496 + 770870b commit db9bc91

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

schemas/agent-preview.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
"type": "null"
77
}
88
}
9-
}
9+
}

src/handleTestResults.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77
import { join } from 'node:path';
8+
import { stripVTControlCharacters } from 'node:util';
89
import { writeFile, mkdir } from 'node:fs/promises';
910
import { AgentTestResultsResponse, convertTestResultsToFormat, humanFriendlyName } from '@salesforce/agents';
1011
import { Ux } from '@salesforce/sf-plugins-core/Ux';
@@ -158,7 +159,7 @@ export async function handleTestResults({
158159
const formatted = humanFormat(results);
159160
if (outputDir) {
160161
const file = `test-result-${id}.txt`;
161-
await writeFileToDir(outputDir, file, formatted);
162+
await writeFileToDir(outputDir, file, stripVTControlCharacters(formatted));
162163
ux.log(`Created human-readable file at ${join(outputDir, file)}`);
163164
} else {
164165
ux.log(formatted);

0 commit comments

Comments
 (0)