Skip to content

Commit

Permalink
fix: filter color char from testing output
Browse files Browse the repository at this point in the history
Fixed: Test peeker shows escape characters instead of ANSI colors #34
  • Loading branch information
zxch3n committed May 17, 2022
1 parent f2ef700 commit 730ae97
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pure/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@ export class TestRunner {
let outputs: string[] = [];
const env = { ...process.env, ...workspaceEnv };
try {
function _log(line: string) {
log(filterColorFormatOutput(line.trimEnd()) + "\r\n");
outputs.push(filterColorFormatOutput(line));
}

// it will throw when test failed or the testing is failed to run
await execWithLog(command, args, {
env,
cwd: workspacePath,
}, (line) => {
log((line.trimEnd()) + "\r\n");
outputs.push(filterColorFormatOutput(line));
}, (line) => {
log((line.trimEnd()) + "\r\n");
outputs.push(filterColorFormatOutput(line));
}).promise;
}, _log, _log).promise;

} catch (e) {
error = e;
}
Expand Down

0 comments on commit 730ae97

Please sign in to comment.