mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-24 07:46:39 +00:00
Omit unicode control character escapes from test logs
Change-type: patch
This commit is contained in:
parent
9f9fd97795
commit
4e101e2fd9
@ -64,18 +64,24 @@ export function filterCliOutputForTests({
|
|||||||
err: string[];
|
err: string[];
|
||||||
out: string[];
|
out: string[];
|
||||||
}): { err: string[]; out: string[] } {
|
}): { err: string[]; out: string[] } {
|
||||||
|
// eslint-disable-next-line no-control-regex
|
||||||
|
const unicodeCharacterEscapesRegex = /\u001b\[3[0-9]m/g;
|
||||||
return {
|
return {
|
||||||
err: err.filter(
|
err: err
|
||||||
(line: string) =>
|
.map((line) => line.replaceAll(unicodeCharacterEscapesRegex, ''))
|
||||||
line &&
|
.filter(
|
||||||
!line.match(/\[debug\]/i) &&
|
(line: string) =>
|
||||||
// TODO stop this warning message from appearing when running
|
line &&
|
||||||
// sdk.setSharedOptions multiple times in the same process
|
!line.match(/\[debug\]/i) &&
|
||||||
!line.startsWith('Shared SDK options') &&
|
// TODO stop this warning message from appearing when running
|
||||||
!line.startsWith('WARN: disabling Sentry.io error reporting') &&
|
// sdk.setSharedOptions multiple times in the same process
|
||||||
!matchesNodeEngineVersionWarn(line),
|
!line.startsWith('Shared SDK options') &&
|
||||||
),
|
!line.startsWith('WARN: disabling Sentry.io error reporting') &&
|
||||||
out: out.filter((line: string) => line && !line.match(/\[debug\]/i)),
|
!matchesNodeEngineVersionWarn(line),
|
||||||
|
),
|
||||||
|
out: out
|
||||||
|
.map((line) => line.replaceAll(unicodeCharacterEscapesRegex, ''))
|
||||||
|
.filter((line) => line && !line.match(/\[debug\]/i)),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user