Skip to content

test(admin): use jsdom's Web Storage on Node 25 and later - #25

Merged
Schero94 merged 1 commit into
mainfrom
test/strictmode-harness-node25-storage
Nov 18, 2026
Merged

Schero94 merged 1 commit into
mainfrom
test/strictmode-harness-node25-storage

Conversation

@Schero94

Copy link
Copy Markdown
Owner

Follow-up to #24 (plan item P2). Node 25+ defines its own localStorage/sessionStorage globals (undefined without --localstorage-file), so tests/admin/harness/setup.mjs kept them instead of jsdom's and the Strapi admin providers threw Cannot read properties of undefined (reading 'getItem'). Seen on Node 26 in the Magic Link CI (this repo's CI matrix is Node 22/24, so it did not fail here yet). The harness now defines jsdom's storage on the global object. Keeps the five shared harness files identical across Session Manager, Magic Link and MagicMail.

Local: npm run test:admin 11/11 pass (Node 22.23.1), lint and format check clean. Test-only change: no release.

🤖 Generated with Claude Code

Node 25+ defines its own localStorage and sessionStorage globals
(undefined without --localstorage-file), so the StrictMode harness kept
them and the Strapi admin providers failed on Node 26 (seen in the Magic
Link CI). Keeps the shared harness files identical across the plugins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Schero94
Schero94 merged commit 8e05cf2 into main Nov 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant