mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 21:57:51 +00:00
Omit unicode control character escapes from test logs
Change-type: patch
This commit is contained in:
parent
9f9fd97795
commit
4e101e2fd9
@ -64,8 +64,12 @@ export function filterCliOutputForTests({
|
||||
err: string[];
|
||||
out: string[];
|
||||
}): { err: string[]; out: string[] } {
|
||||
// eslint-disable-next-line no-control-regex
|
||||
const unicodeCharacterEscapesRegex = /\u001b\[3[0-9]m/g;
|
||||
return {
|
||||
err: err.filter(
|
||||
err: err
|
||||
.map((line) => line.replaceAll(unicodeCharacterEscapesRegex, ''))
|
||||
.filter(
|
||||
(line: string) =>
|
||||
line &&
|
||||
!line.match(/\[debug\]/i) &&
|
||||
@ -75,7 +79,9 @@ export function filterCliOutputForTests({
|
||||
!line.startsWith('WARN: disabling Sentry.io error reporting') &&
|
||||
!matchesNodeEngineVersionWarn(line),
|
||||
),
|
||||
out: out.filter((line: string) => line && !line.match(/\[debug\]/i)),
|
||||
out: out
|
||||
.map((line) => line.replaceAll(unicodeCharacterEscapesRegex, ''))
|
||||
.filter((line) => line && !line.match(/\[debug\]/i)),
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user