Suppress verbose web test trace output
This commit is contained in:
@@ -29,6 +29,8 @@ const angularTestResourcePathCache = new Map<string, string>();
|
|||||||
const angularTestResourceContentCache = new Map<string, string>();
|
const angularTestResourceContentCache = new Map<string, string>();
|
||||||
const suppressedTestWarnFragments = [
|
const suppressedTestWarnFragments = [
|
||||||
'WARNING: sanitizing HTML stripped some content',
|
'WARNING: sanitizing HTML stripped some content',
|
||||||
|
'Translation key not found:',
|
||||||
|
'[TenantAuth] ',
|
||||||
];
|
];
|
||||||
const suppressedTestErrorFragments = [
|
const suppressedTestErrorFragments = [
|
||||||
"Not implemented: navigation to another Document",
|
"Not implemented: navigation to another Document",
|
||||||
@@ -41,6 +43,14 @@ const suppressedTestErrorFragments = [
|
|||||||
'GraphViz render error:',
|
'GraphViz render error:',
|
||||||
'Evidence bundle export failed:',
|
'Evidence bundle export failed:',
|
||||||
];
|
];
|
||||||
|
const suppressedTestLogFragments = [
|
||||||
|
'[TenantAuth] ',
|
||||||
|
'Downloading evidence:',
|
||||||
|
];
|
||||||
|
const suppressedTestDebugFragments = [
|
||||||
|
'[VulnHttpClient]',
|
||||||
|
'[TenantAuth] ',
|
||||||
|
];
|
||||||
|
|
||||||
class TestResizeObserver {
|
class TestResizeObserver {
|
||||||
observe(): void {}
|
observe(): void {}
|
||||||
@@ -125,9 +135,18 @@ if (!(globalThis as Record<string, unknown>)[angularTestEnvironmentKey]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(globalThis as Record<string, unknown>)[angularTestConsolePatchKey]) {
|
if (!(globalThis as Record<string, unknown>)[angularTestConsolePatchKey]) {
|
||||||
|
const originalLog = console.log.bind(console);
|
||||||
const originalWarn = console.warn.bind(console);
|
const originalWarn = console.warn.bind(console);
|
||||||
|
const originalDebug = console.debug.bind(console);
|
||||||
const originalError = console.error.bind(console);
|
const originalError = console.error.bind(console);
|
||||||
|
|
||||||
|
console.log = (...args: unknown[]) => {
|
||||||
|
if (consoleMessageIncludesAny(args, suppressedTestLogFragments)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
originalLog(...args);
|
||||||
|
};
|
||||||
|
|
||||||
console.warn = (...args: unknown[]) => {
|
console.warn = (...args: unknown[]) => {
|
||||||
if (consoleMessageIncludesAny(args, suppressedTestWarnFragments)) {
|
if (consoleMessageIncludesAny(args, suppressedTestWarnFragments)) {
|
||||||
return;
|
return;
|
||||||
@@ -135,6 +154,13 @@ if (!(globalThis as Record<string, unknown>)[angularTestConsolePatchKey]) {
|
|||||||
originalWarn(...args);
|
originalWarn(...args);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.debug = (...args: unknown[]) => {
|
||||||
|
if (consoleMessageIncludesAny(args, suppressedTestDebugFragments)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
originalDebug(...args);
|
||||||
|
};
|
||||||
|
|
||||||
console.error = (...args: unknown[]) => {
|
console.error = (...args: unknown[]) => {
|
||||||
if (consoleMessageIncludesAny(args, suppressedTestErrorFragments)) {
|
if (consoleMessageIncludesAny(args, suppressedTestErrorFragments)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user