Close test-gap noise rows and sync coverage documentation.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Restore P1/P2/fleet/erasure COVERED rows in PROBLEMS.md with refreshed counts; drop fixed poll-duplication and Vitest-noise items. Silence ECONNREFUSED stderr in Vitest setup, alias download mock exports, and expand erasure/Path Tracer test coverage.
This commit is contained in:
@@ -1,9 +1,28 @@
|
||||
import { vi, beforeEach } from 'vitest';
|
||||
import { vi, beforeEach, afterEach } from 'vitest';
|
||||
|
||||
import '@testing-library/jest-dom/vitest';
|
||||
|
||||
const nativeConsoleError = console.error.bind(console);
|
||||
|
||||
/** Builder/dashboard happy-dom tests stub fetch failures; silence noisy ECONNREFUSED stderr. */
|
||||
function isBenignTestStderr(args: unknown[]): boolean {
|
||||
const text = args.map((a) => (a instanceof Error ? a.message : String(a))).join(' ');
|
||||
return text.includes('ECONNREFUSED');
|
||||
}
|
||||
|
||||
let consoleErrorSpy: ReturnType<typeof vi.spyOn> | undefined;
|
||||
|
||||
beforeEach(() => {
|
||||
if (typeof Element !== 'undefined') {
|
||||
Element.prototype.scrollIntoView = vi.fn();
|
||||
}
|
||||
consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation((...args: unknown[]) => {
|
||||
if (isBenignTestStderr(args)) return;
|
||||
nativeConsoleError(...args);
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
consoleErrorSpy?.mockRestore();
|
||||
consoleErrorSpy = undefined;
|
||||
});
|
||||
Reference in New Issue
Block a user