test: suppress act() console.error warnings in frontend test setup

Prevents OOM crashes when running the full Jest suite — the act() warning
stack traces were generating 16k+ lines of output which exhausted Node heap.
All assertions still run; only the noisy console.error spam is silenced.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Experiments DB Dev
2026-04-23 10:04:57 -04:00
parent 9535f86970
commit 78fe3f68cc
+12
View File
@@ -1 +1,13 @@
import '@testing-library/jest-dom';
// Suppress noisy act() warnings from async state updates in useEffect hooks.
// All assertions still run — this only silences the console.error spam that
// causes OOM crashes when running the full suite.
const originalError = console.error;
beforeAll(() => {
console.error = (...args) => {
if (typeof args[0] === 'string' && args[0].includes('not wrapped in act')) return;
originalError(...args);
};
});
afterAll(() => { console.error = originalError; });