mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
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]>