Skip to content

Commit

Permalink
Merge pull request #103 from salesforcecli/cd/test-result-strip-ansi
Browse files Browse the repository at this point in the history
fix: strip ANSI escape codes from test results W-17919369
  • Loading branch information
WillieRuemmele authored Feb 27, 2025
2 parents 710d496 + 770870b commit db9bc91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion schemas/agent-preview.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"type": "null"
}
}
}
}
3 changes: 2 additions & 1 deletion src/handleTestResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import { join } from 'node:path';
import { stripVTControlCharacters } from 'node:util';
import { writeFile, mkdir } from 'node:fs/promises';
import { AgentTestResultsResponse, convertTestResultsToFormat, humanFriendlyName } from '@salesforce/agents';
import { Ux } from '@salesforce/sf-plugins-core/Ux';
Expand Down Expand Up @@ -158,7 +159,7 @@ export async function handleTestResults({
const formatted = humanFormat(results);
if (outputDir) {
const file = `test-result-${id}.txt`;
await writeFileToDir(outputDir, file, formatted);
await writeFileToDir(outputDir, file, stripVTControlCharacters(formatted));
ux.log(`Created human-readable file at ${join(outputDir, file)}`);
} else {
ux.log(formatted);
Expand Down

0 comments on commit db9bc91

Please sign in to comment.