Repository navigation
test(setup): a working DOM Storage for renderer tests on Node 25 (#1212) - #1408
Merged
Merged
Conversation
… shadows happy-dom's (#1212) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ode 25 file-backed storage (#1408 review c) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
Review disposition (head 47b7fb3)
Residual: Node 25 warning noise in test output (b's minor), as above. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1212.
Plan:
docs/plans/2026-09-27-node25-renderer-storage.md.Problem
On Node 25,
recentCommandHistory.renderer.test.tsfailed withwindow.localStorage.clear is not a function, and a read returnedundefined. I reproduced it with Node 25.5.0.Node 25 turns Web Storage on by default. Without
--localstorage-file, itsglobalThis.localStorageis a half-initialised placeholder (with the warning "--localstorage-filewas provided without a valid path"). Because the global already exists, Vitest's happy-dom environment leaves it in place, so renderer code talks to Node's broken storage instead of the DOM's.What merges
testing/setup/storage.tsinstallWorkingStorage(): puts a happy-domStorageonlocalStorage/sessionStoragewherever the existing one has noclear. The renderer setup file calls it. On Node 22/24 it is a no-op.tsconfig.web.json: lists the new setup file.Tests
testing/unit/setupStorage.test.ts: replaces a Node-25-shaped stand-in and leaves a working storage alone. It is a unit test because CI runs Node 24, where the real global is fine.src/renderer/src/app/storageEnvironment.renderer.test.ts: the renderer environment's storage works.npx tsc -b+testing/unit+src/renderer/src/app+src/renderer/src/features/command-paletteon25b1a2f4(45 files, 378 tests).Out of scope: any other Node 25 incompatibility in the full suite.
🤖 Generated with Claude Code