From 78fe3f68cc6c9b5b2aa37d0f5b39f21d46285f67 Mon Sep 17 00:00:00 2001 From: Experiments DB Dev Date: Thu, 23 Apr 2026 10:04:57 -0400 Subject: [PATCH] test: suppress act() console.error warnings in frontend test setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- frontend/tests/setup.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/tests/setup.js b/frontend/tests/setup.js index 7b0828b..982548f 100644 --- a/frontend/tests/setup.js +++ b/frontend/tests/setup.js @@ -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; });