Four library projects fail their unit tests on a cold cache (locally, or whenever nx can't replay a cached result), while CI looked green by replaying cached pass results:
platform-activity-tracking — every spec crashed (TypeError: localStorage.clear is not a function)
shared-js-formatting-options — persists across service re-instantiation (localStorage hydration)
feature-games-clue-for-sql — localStorage.removeItem is not a function
Under the Angular @angular/build:unit-test builder's default environment, localStorage is a partial / "split" Storage: clear/removeItem throw is not a function and setItem writes aren't visible to getItem. The repo already ships a canonical in-memory Storage polyfill at testing/storage-test-setup.ts (mirroring projects/spikersoft/src/test-setup.ts), but these four library vitest.config.ts files never added it to their setupFiles.
Fix
Add the existing testing/storage-test-setup.ts to each project's setupFiles. No production code changes.
Resolved in spikersoft-angular PR #69 (merged to master).
## Problem
Four library projects fail their unit tests on a **cold cache** (locally, or whenever nx can't replay a cached result), while CI looked green by replaying cached pass results:
- `platform-activity-tracking` — every spec crashed (`TypeError: localStorage.clear is not a function`)
- `shared-js-formatting-options` — `persists across service re-instantiation (localStorage hydration)`
- `feature-games-clue-for-sql` — `localStorage.removeItem is not a function`
- `feature-dev-tools-reg-ex` — localStorage-backed specs
## Root cause
Under the Angular `@angular/build:unit-test` builder's default environment, `localStorage` is a partial / "split" Storage: `clear`/`removeItem` throw `is not a function` and `setItem` writes aren't visible to `getItem`. The repo already ships a canonical in-memory Storage polyfill at `testing/storage-test-setup.ts` (mirroring `projects/spikersoft/src/test-setup.ts`), but these four library `vitest.config.ts` files never added it to their `setupFiles`.
## Fix
Add the existing `testing/storage-test-setup.ts` to each project's `setupFiles`. No production code changes.
Resolved in spikersoft-angular PR #69 (merged to `master`).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Four library projects fail their unit tests on a cold cache (locally, or whenever nx can't replay a cached result), while CI looked green by replaying cached pass results:
platform-activity-tracking— every spec crashed (TypeError: localStorage.clear is not a function)shared-js-formatting-options—persists across service re-instantiation (localStorage hydration)feature-games-clue-for-sql—localStorage.removeItem is not a functionfeature-dev-tools-reg-ex— localStorage-backed specsRoot cause
Under the Angular
@angular/build:unit-testbuilder's default environment,localStorageis a partial / "split" Storage:clear/removeItemthrowis not a functionandsetItemwrites aren't visible togetItem. The repo already ships a canonical in-memory Storage polyfill attesting/storage-test-setup.ts(mirroringprojects/spikersoft/src/test-setup.ts), but these four libraryvitest.config.tsfiles never added it to theirsetupFiles.Fix
Add the existing
testing/storage-test-setup.tsto each project'ssetupFiles. No production code changes.Resolved in spikersoft-angular PR #69 (merged to
master).