refactor(test): extract the duplicated Node 26 jsdom localStorage guard into a shared helper#7624
Merged
Merged
Conversation
…rd (#7620) #7612's fix mirrored #7597's Node 26 jsdom/localStorage guard verbatim into apps/loopover-ui and packages/loopover-ui-kit, on top of the existing copy already in apps/loopover-miner-ui -- three copies of the same ~15-line guard that can drift, and a fourth future jsdom workspace wouldn't automatically inherit the fix. Extract into test/helpers/vitest-jsdom-node26-localstorage.ts, exporting one patchJsdomLocalStorageForNode26() function. All three vitest.setup.ts files now import and call it instead of inlining the logic. No behavior change -- same guard, same no-op-on-Node-22/24 / fix-on-Node-26+ semantics. Verified on Node 26: all three consuming workspaces' full test suites pass post-extraction (loopover-ui 79/79 files, ui-kit 3/3, ui-miner 28/28) -- the regression proof for a helper this thin, matching this repo's existing test/helpers/*.ts convention of no dedicated test file. Closes #7620
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
loopover-ui | bad44f4 | Jul 21 2026, 04:24 AM |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Bundle ReportChanges will increase total bundle size by 106 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
1 task
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.
Closes #7620
Summary
localStorageguard (previously copy-pasted verbatim inapps/loopover-miner-ui,apps/loopover-ui, andpackages/loopover-ui-kit'svitest.setup.ts) intoone shared
test/helpers/vitest-jsdom-node26-localstorage.tsmodule all three now import. No behaviorchange — same guard, just one copy instead of three that could drift.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
test/**, outside Codecov'ssrc/**-only include glob. No dedicatedunit test for the helper itself, matching this repo's existing
test/helpers/*.tsconvention (e.g.test/helpers/d1.tshas none either) — it's exercised directly and thoroughly by the real consumingtest suites. Verified on Node 26 (not just asserted): all three consuming workspaces' full suites pass
post-extraction (loopover-ui 79/79 files, ui-kit 3/3, ui-miner 28/28).
Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
Not applicable — pure test-infrastructure refactor, no visible UI/frontend difference.
Notes