Files
google-labs-jules[bot]andPR0M3TH3AN 614e30a61a fix(test): polyfill synchronous requestIdleCallback for unit tests
Fixes flaky/failing unit tests in `tests/state/profile-cache.test.mjs` caused by the recent optimization to defer `localStorage` writes using `requestIdleCallback`.

In the JSDOM environment, `requestIdleCallback` was missing, causing a fallback to `setTimeout`, which introduced asynchronous behavior that the existing tests did not account for.

This change adds a synchronous polyfill for `requestIdleCallback` in `tests/test-helpers/setup-localstorage.mjs`, ensuring that deferred writes happen immediately during testing, restoring deterministic behavior.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-05 23:04:21 +00:00
..