[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78FMWTX4X7PAPVS1E6JQ42H":3,"skill-same:01M78FMWTX4X7PAPVS1E6JQ42H":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M78FMWTX4X7PAPVS1E6JQ42H","solid-test-infrastructure",null,"Use when creating Solid package or app tests, running Vitest against injected fetch seams, starting a local Community Solid Server for Playwright, seeding accounts and profiles, or preventing flaky\u002Fvacuous authenticated integration tests.","jeswr\u002Fsolid-sdk","jeswr","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F63333554?v=4","01M78F8AE112CQ0KHFC3R0Z8SJ","Jesse Wright","01M78F8AERJX4YWDA1S4BMF74V",2,"MIT","https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fsolid-test-infrastructure\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: solid-test-infrastructure\ndescription: Use when creating Solid package or app tests, running Vitest against injected fetch seams, starting a local Community Solid Server for Playwright, seeding accounts and profiles, or preventing flaky\u002Fvacuous authenticated integration tests.\n---\n\n## Quick reference\n\n\u003C!-- AUTHORED-BY Codex GPT-6 -->\n\n\u003C!-- AUTHORED-BY Codex GPT-5 -->\n\n**Test Solid code against real protocol behavior**\n\nUse two layers:\n\n- Vitest for pure logic and data layers with injected fetch, clock, storage, crypto, and network seams.\n- Playwright or integration tests against one long-lived local Community Solid Server for actual HTTP, OIDC, DPoP, LDP, ETag, and browser behavior.\n\n### Harness rules\n\n- Start the server once per suite\u002Fworker, not once per test. Isolate writes with fresh accounts or pod roots.\n- Give CSS and the app distinct fixed ports. Probe the CSS account API rather than treating any HTTP 200 as the right service.\n- Seed fresh profiles with the WebID data tests require, including name and `pim:storage`; bare profiles make otherwise-correct application tests appear broken.\n- Use client-credentials DPoP fixtures for data arrangement. Keep one focused browser test for the real interactive popup path.\n- Before claiming an authenticated read worked, assert the resource is actually private with an anonymous 401\u002F403.\n- Pin the CSS version used in CI.\n- Never skip a non-completing login implicitly. A login timeout is a test failure unless an explicit opt-in skip is part of the test contract.\n- Avoid fixed sleeps. Wait on observable state, responses, or lifecycle seams.\n\n### Non-vacuous security tests\n\n- Drive real OAuth\u002FDPoP code over a stub transport rather than mocking away the library under test.\n- Verify signatures, `htm`\u002F`htu`, `ath`, `jkt`, nonce retry, token rotation, and replay behavior.\n- Exercise logout\u002Faccount-switch races and delayed stale operations.\n- For 401-budget tests, seed several private resources, count response statuses under the storage origin, and prove challenges do not scale per resource.\n- Match exact RDF namespace schemes in fixtures so a successful empty query cannot pass the test accidentally.\n\nIn ESM packages, keep Playwright config\u002Fsetup ESM-safe: use relative module paths, derive paths from `import.meta.url`, and avoid `require`\u002F`__dirname`. Keep test helpers reviewable text—write escaped separators rather than literal NUL bytes.\n\n### Agent persona\n\nWhen this work is delegated to a sub-agent, spawn the `solid-test-engineer` persona from\n[`.claude\u002Fagents\u002Fsolid-test-engineer.md`](..\u002F..\u002F.claude\u002Fagents\u002Fsolid-test-engineer.md) — it routes through this skill.\nOrchestration: `.claude\u002Fagents\u002Fsolid-app-orchestration.md`.\n\n\u003C!-- AUTHORED-BY Codex GPT-6.1-Sol -->\n\n# Solid test infrastructure — build it before the features\n\n**The test infrastructure is part of the scaffold, not an afterthought.** Stand it up right\nafter `create-next-app`, before the first feature — then every feature lands with its tests,\nand TDD is possible: write the failing test (unit or e2e), implement, go green, refactor.\n(Install the `test-driven-development` skill from `obra\u002Fsuperpowers` for the discipline; this\nskill is the Solid-specific machinery.)\n\nTwo layers, per [`AGENTS.md`](..\u002F..\u002FAGENTS.md) Part 2 §Testing:\n\n| Layer | Tool | Scope |\n|---|---|---|\n| Unit \u002F integration | **Vitest** | `src\u002Flib\u002F` — the data layer; `fetch` injected as an **optional** param, omitted in production paths |\n| End-to-end | **Playwright** | Golden paths against a **real local CSS** — login popup included; no mocks |\n\n## The bundled harness (execution-verified)\n\nTwo files, lifted verbatim from the clean-room verification build that validated this guide —\nthey powered full popup-login e2e runs (3\u002F3 stable) and authenticated write-path tests:\n\n1. **[`playwright.config.ts`](references\u002Fplaywright.config.ts.md)** — the two-`webServer` pattern: one\n   in-memory CSS@7 on `:3000` (it must own that port — the auth issuer map requires it) and the\n   app on `:3200` (`next dev` would otherwise clash on 3000; **using another framework, swap\n   that webServer command for your dev server on `:3200`** — the harness is framework-agnostic,\n   as is `dev.mjs` via `APP_CMD`). One CSS instance per suite — startup is ~13s, so never\n   per-test. `reuseExistingServer` keeps local iteration fast.\n2. **[`global-setup.ts`](references\u002Fglobal-setup.ts.md)** — runs once after the servers are up:\n   - creates a unique account and pod per run via the CSS account API (`POST \u002F.account\u002Faccount\u002F` with `{}` — with a\n     JSON content-type an empty body 500s), registers a password, creates the pod;\n   - mints **client-credentials**, then exchanges them for a **DPoP-bound token** (jose-built\n     proofs — note the `ath` claim on resource requests);\n   - **seeds the profile** — a fresh CSS pod profile has no `foaf:name` and no `pim:storage`\n     (so no display name and no write path); the setup PUTs them plus a photo;\n   - passes `{ webId, email, password, podRoot }` to test workers through\n     `process.env.SOLID_E2E_ACCOUNT`, without logging credentials.\n\n3. **[`css-account.ts`](references\u002Fcss-account.ts.md)** — the per-test account fixture:\n   `createCssAccount({ pod })` returns `{ webId, email, password, podRoot, token, proof }` with\n   the bare profile seeded — fresh-account-per-write-test isolation without restarting CSS\n   (compile-verified; same recipe as global-setup, packaged per call).\n\nCopy what you need; keep the unique per-run account names and consume the setup credentials\nin tests rather than hardcoding Alice. `jose` is the only\nextra dev-dependency. Alternative to run-time profile seeding: start CSS with the **custom pod\ntemplates** from this repo's `config\u002Fpod-templates\u002F` (+ `config\u002Fcss-memory-wac-templates.json`)\nand every pod is born with `pim:storage` — see `docs\u002Flocal-ops.md` for the verified mechanics\nand the `--seedConfig` boot-time account seeding.\n\n## The dev environment — seeded and ready to log in\n\n`npm run dev` must give the developer a **testable** environment, not just a compiling app:\nCSS running, accounts already seeded, and the **credentials printed where they can't be\nmissed**. The bundled [`dev.mjs`](references\u002Fdev.mjs.md) (execution-verified) does exactly that — starts\nin-memory CSS on `:3000`, seeds two accounts (alice\u002Fbob, profile names + `pim:storage`\nincluded), prints a credentials banner (WebID \u002F email \u002F password \u002F pod root per account), then\nstarts the app on `:3200`. Wire it as the dev script:\n\n```json\n{ \"scripts\": { \"dev\": \"node scripts\u002Fdev.mjs\" } }\n```\n\n`node scripts\u002Fdev.mjs --no-app` gives CSS + seeded accounts only — run it once in its own\nterminal and leave it up: **CSS takes ~15 s to boot, so avoid restarting it**. The script\nreuses a CSS already on `:3000` (tolerating existing accounts), so app restarts never pay the\nCSS boot cost. It detects that reuse by probing the CSS-specific account API\n(`GET \u002F.account\u002F` → JSON), **not** a bare `200` on `\u002F` — so a stray `next dev` (whose default\nport is also `3000`) won't be mistaken for CSS; if something non-CSS owns `:3000` the script\nfails fast with an `lsof -i :3000` hint instead of seeding against the wrong server. For clean\nstate, prefer a fresh account (`createCssAccount`) over a restart.\n\n## Patterns the harness enables\n\n- **Authenticated fixtures without the popup**: the client-credentials DPoP token from\n  global-setup reads\u002Fwrites the pod directly — use it to arrange test data and to test the\n  data layer against live CSS (fast, no browser). Interactive popup login stays in exactly one\n  or two e2e specs.\n- **401-gated assertions**: before asserting authenticated content, confirm the resource\n  returns `401` unauthenticated — then a passing test *proves* the auth upgrade ran; a false\n  pass is impossible.\n- **Write isolation**: in-memory CSS resets on restart; for a pristine pod per suite, restart\n  CSS. For write-heavy suites, `createCssAccount` (bundled) gives a fresh account + seeded\n  profile + DPoP token per test — no shared-pod interference, no restart.\n- **Popup flows**: capture the OIDC popup with `context.waitForEvent(\"page\")`; CSS login is\n  `#email` \u002F `#password` → \"Log in\" → \"Authorize\". Ignore the transient `prompt=none` popup\n  that closes itself before the interactive one opens.\n\n## Per-feature loop (the actual instruction)\n\nFor every feature: **(1)** write the failing Vitest case against the data-layer contract\n(mock `fetch` via the optional param), **(2)** implement until green, **(3)** extend — or\nconfirm coverage by — an e2e golden path. A feature without tests is not done. Don't\nsnapshot-test UI, don't test shadcn primitives, don't `sleep()` — auto-waits only.\n\n[`feature.spec.example.ts`](references\u002Ffeature.spec.example.ts.md) is the per-feature e2e template —\ndistilled from a real Bob-built TODO app developed against this guide: login error-states\nfirst (they're the executable form of the `solid-reactive-authentication` UX spec), a\nshared popup-login helper in `beforeEach` (email\u002Fpassword and consent), role\u002Fplaceholder locators, empty-state → create → persist-across-reload.\n\n## PGlite-backed services — boot once per worker, reset between tests\n\nWhen testing a Postgres-backed Solid service with\n[`@electric-sql\u002Fpglite`](https:\u002F\u002Fgithub.com\u002Felectric-sql\u002Fpglite) (in-process WASM Postgres) under\nvitest, **do NOT `new PGlite()` per test or per suite** — the WASM boot takes ~1 s each and\nparallel boots thrash CPU, forcing long test timeouts and slow suites. Instead **boot one engine\nper vitest worker and reset the schema (~80 ms) between tests** (drop + recreate or truncate).\n\nIn `jeswr\u002Fsolid-webid-index` this cut the suite from ~683 s cumulative \u002F ~123 s wall-clock to\n~90 s \u002F ~16 s (≈7.5×) and removed the need for inflated per-test timeouts.\n\n**Pattern:**\n\n```ts\n\u002F\u002F test\u002Fhelpers\u002Fdb.ts  (imported by every test file)\nimport { PGlite } from \"@electric-sql\u002Fpglite\";\n\n\u002F\u002F Kick off the WASM boot immediately at module load so it overlaps vitest's import phase.\nconst enginePromise = PGlite.create();\n\nexport async function freshDb(): Promise\u003CPGlite> {\n  const db = await enginePromise;\n  \u002F\u002F Drop and recreate the schema — ~80 ms vs ~1 s for a new engine.\n  await db.exec(\"DROP SCHEMA public CASCADE; CREATE SCHEMA public;\");\n  await runMigrations(db);   \u002F\u002F your app's migration function\n  return db;\n}\n```\n\n```ts\n\u002F\u002F my-feature.test.ts\nimport { freshDb } from \".\u002Fhelpers\u002Fdb.js\";\n\nlet db: PGlite;\nbeforeEach(async () => { db = await freshDb(); });\n\u002F\u002F No afterAll close — the shared engine lives for the whole worker lifetime.\n```\n\nRules:\n- **Never `close()` the shared engine** mid-suite; it cannot be reopened.\n- Route every test through one shared `freshDb()` \u002F `freshTestStore()` helper — never call\n  `PGlite.create()` directly in a test file.\n- Each vitest worker gets its own engine (vitest isolates workers) so tests in different files\n  run truly in parallel without contention.\n\n## ESM project (`\"type\": \"module\"`) — Playwright loads the config + setup files as ESM\n\nIn a package with `\"type\": \"module\"` in `package.json`, **Playwright loads its `.ts` config AND\nthe imported `globalSetup`\u002F`globalTeardown`\u002Ffixture files as ESM** — regardless of a nested\n`e2e\u002Ftsconfig.json` set to `module: commonjs`. So a CJS-only construct in any of those files\nthrows at config-parse time (in CI, before a single test runs) — both `require` and `__dirname`\nare simply not defined in an ES module:\n\n- `require` \u002F `require.resolve(...)` → `ReferenceError: require is not defined in ES module scope`;\n- `__dirname` → `ReferenceError: __dirname is not defined in ES module scope`.\n\nFix:\n\n- in the Playwright config, pass `globalSetup`\u002F`globalTeardown` as plain **relative path strings**\n  (Playwright resolves them against the config dir) — not `require.resolve(...)`;\n- in the setup files, derive `__dirname` from `import.meta.url`:\n  ```ts\n  import { fileURLToPath } from \"node:url\";\n  import { dirname } from \"node:path\";\n  const __dirname = dirname(fileURLToPath(import.meta.url));\n  ```\n- set the e2e `tsconfig.json` to `module: ESNext` + `moduleResolution: bundler` so `import.meta`\n  is type-correct.\n\n(Learned fixing the `jeswr\u002Fsolid-browser-extension` e2e CI — the ESM-config fix. This is the\nESM-default mirror of the CJS-default `globalSetup` transpiler gotcha below.)\n\n## Node version — 25.1 breaks SSR\u002Fprerender via `localStorage`\n\nNode 25.1 ships `globalThis.localStorage` as a **truthy object whose methods are\nnon-functional** unless `--localstorage-file` is set. That silently breaks the standard\nbrowser-detection guard used to keep Solid client code (and any `localStorage`-touching code)\nout of the server render path:\n\n```ts\n\u002F\u002F Passes on Node 25.1 even though localStorage.getItem() then throws —\n\u002F\u002F the object exists, so `typeof` sees \"object\", not \"undefined\".\nif (typeof localStorage !== \"undefined\") {\n  const cached = localStorage.getItem(key); \u002F\u002F throws server-side\n}\n```\n\nUnder Next.js (or any SSR\u002Fprerender framework) this makes a page that only touches\n`localStorage` behind a `typeof` guard 500 at build\u002Fprerender time — on Node ≤24 the same guard\ncorrectly evaluates `false` server-side and skips the branch. This bit the `jeswr\u002Felk` fork's `\u002F`\nprerender.\n\nFix, in order of preference:\n- **Build\u002Fprerender on Node ≤24** — pin it (`.nvmrc` \u002F `package.json` `engines.node`) so CI and\n  every contributor's local build use a version where the guard behaves.\n- **Feature-detect by calling, not by `typeof`** — wrap the actual access in try\u002Fcatch instead of\n  trusting existence:\n  ```ts\n  function hasWorkingLocalStorage(): boolean {\n    try {\n      localStorage.setItem(\"__probe__\", \"1\");\n      localStorage.removeItem(\"__probe__\");\n      return true;\n    } catch {\n      return false;\n    }\n  }\n  ```\n- Do both — the `.nvmrc`\u002F`engines` pin keeps the whole toolchain (not just this one guard)\n  behaving consistently; the call-based probe is the defensive fallback for code you don't\n  control.\n\n(Learned in the `jeswr\u002Felk` fork upstream-sync, 2026-07-02 — verified by reproduction: the\n`typeof` guard passed and `\u002F` prerendered fine on Node 24, then 500'd on Node 25.1 with the exact\nsame source.)\n\n## jsdom + Radix UI — `fireEvent.pointerDown` never opens a dropdown\n\nRadix UI menu triggers (DropdownMenu and friends — the menus shadcn wraps) open from a\n`pointerdown` event whose `button === 0`. jsdom **before v27** has no `PointerEvent`\nconstructor (check `typeof window.PointerEvent`), so there Testing Library's\n`fireEvent.pointerDown` falls back to constructing a generic `Event` and the `MouseEvent`-init\nfields (`button`, `ctrlKey`, …) are silently dropped — `event.button` is `undefined`, Radix's\n`button === 0` trigger check fails, and the menu never opens. No error, no warning: the same\ncomponent works in a real browser, but under vitest\u002Fjsdom the menu content simply never appears\nin the document. (jsdom ≥27 implements `PointerEvent`, so upgrading removes the fallback path —\nthe workaround below is for environments pinned to an older jsdom.)\n\nFix: construct the `MouseEvent` yourself with `type: \"pointerdown\"` — jsdom implements\n`MouseEvent` fully and it carries `button: 0` by default — and dispatch it **through\n`fireEvent(element, event)`** so Testing Library still wraps the dispatch in React's `act()`\n(a raw `element.dispatchEvent(...)` skips that and can leave you asserting before the\nresulting state updates settle, with act warnings):\n\n```ts\n\u002F\u002F fireEvent.pointerDown(trigger);  \u002F\u002F ✗ generic Event in jsdom — button undefined, no open\nfireEvent(trigger, new MouseEvent(\"pointerdown\", { bubbles: true })); \u002F\u002F ✓ button: 0 — opens\n```\n\nVerified on dropdown menus. Radix **Select** triggers additionally check\n`event.pointerType === \"mouse\"`, which a bare `MouseEvent` also lacks — if a Select still won't\nopen, attach the field to the constructed event first:\n\n```ts\nfireEvent(\n  trigger,\n  Object.assign(new MouseEvent(\"pointerdown\", { bubbles: true }), { pointerType: \"mouse\" }),\n);\n```\n\nSelect also calls the element pointer-capture APIs, which pre-27 jsdom doesn't implement\neither — stub them once in the vitest setup file or the Select tests still throw \u002F stay shut:\n\n```ts\nif (!Element.prototype.hasPointerCapture) {\n  Element.prototype.hasPointerCapture = () => false;\n  Element.prototype.setPointerCapture = () => {};\n  Element.prototype.releasePointerCapture = () => {};\n}\n```\n\n(Learned writing component tests for the suite apps' shadcn\u002FRadix dropdown menus, 2026-07 —\nbead suite-tracker-z7cc. The tell: a dropdown that opens fine in the browser but whose items\nare unreachable in jsdom tests.)\n\n## Clearing a Dependabot backlog in a fork — range-scoped pnpm overrides\n\nWhen syncing an OSS app fork with its upstream, **merging upstream does not clear your\nDependabot alerts** — upstream usually carries the same vulnerable transitive dependencies, so\nthe alerts survive the merge unchanged. To clear a backlog without waiting on upstream:\n\n- Use `pnpm-workspace.yaml` `overrides` in **range-selector form**, scoped to only the vulnerable\n  major (e.g. `\"vulnerable-pkg@^3\": \"^3.2.1\"`), not a blanket pin — a blanket override can drag in\n  an incompatible major and silently break every parallel-major dependent left untouched by the\n  advisory.\n- **Verify the patched version actually exists on npm before writing the override** — an override\n  pointing at a version that was never published leaves `pnpm install` unresolvable.\n- **Regenerate and re-verify the lockfile per alert** — check each Dependabot alert against the\n  regenerated lockfile individually rather than assuming one override run clears all of them.\n- **pnpm ≥11 footgun**: a git-hosted dependency with install\u002Fbuild scripts must be allowlisted by\n  its **exact tarball URL** in `pnpm.allowedDeprecatedVersions`\u002F`onlyBuiltDependencies`-style\n  config. If that dependency is pinned to a moving ref (e.g. `#main`), the allowlist entry breaks\n  every time the upstream ref advances — pin the git dependency by commit SHA, not a branch name,\n  so the allowlist entry stays valid.\n\n(Learned in the `jeswr\u002Felk` fork upstream-sync, 2026-07-02 — each fix verified per-alert against\nthe regenerated lockfile.)\n\n## Pitfalls\n\n### Minimal live round-trip proof\n\n> In the NOTES broker\u002FRS fixture, use `https:\u002F\u002Flocalhost:3000` for requests when that is the\n> configured public URL, TLS hostname, and `PSS_TOKEN_AUDIENCE`. Route TCP to IPv4 separately.\n> DPoP `htu` covers the target URI without query\u002Ffragment; it is not the TCP bind address.\n\nFor an explicitly authorized local\u002Fdisposable integration environment, separate a **minimal\nlive round-trip proof** from the **full UI smoke test**. The minimal proof avoids popup\u002FCOOP\ncoupling, but does not test the app's login UI:\n\n1. Register a test client from Node if the local broker supports dynamic registration.\n2. Navigate the browser's main page to the authorization endpoint using PKCE, state and nonce.\n3. Complete the local identity-provider login and broker consent on that page.\n4. Wait for the exact callback origin\u002Fpath and validate the returned state before taking the code.\n5. Exchange the code from Node for a DPoP-bound token with the same key\u002FPKCE verifier and\n   validate the token response.\n6. PUT, GET and DELETE a unique app-owned test resource, asserting statuses and round-trip data.\n   Confirm anonymous access is denied so success proves authentication.\n\nKeep the popup-driven test as full UI coverage. For work restricted to fixtures\u002Fmocks, exercise\nthe same protocol steps over stub transports; this pattern does not authorize a live service run.\n\n### Broker consent and COOP\n\nInspect the broker's rendered form rather than guessing consent fields. In the NOTES broker,\n`POST \u002Finteraction\u002Fconfirm` uses `decision=accept`; `accept=true` re-presents consent despite\nan HTTP success. Preserve the form's action and hidden\u002FCSRF fields. This is a deployment detail,\nnot a standard OIDC consent form contract.\nIf a popup returns to the callback with no `window.opener`, inspect broker\n`Cross-Origin-Opener-Policy: same-origin`; the reported symptom was a `login_required` callback,\nno second popup, and a hung flow. Prefer the main-page proof above for protocol diagnosis.\nThe source's Chromium flags disabling web security\u002FCOOP are not a production fix and do not\nprove normal browser login works. Test any alternative callback transport (such as\nBroadcastChannel) with the same origin\u002Fstate protections; do not weaken broker headers globally.\n\n### Self-signed TLS in Node workers\n\nNode's built-in fetch uses Undici; `https.Agent` passed as `agent` does not configure it.\nFor local test certificates, prefer trusting the test CA. Where an isolated disposable test\nrequires a bypass, scope it to that local request using an explicitly installed `undici` fetch\nand `Agent` dispatcher, and close the dispatcher afterward. Node bundling Undici internally\ndoes not make `import \"undici\"` available without declaring the dependency.\nThe source's `NODE_TLS_REJECT_UNAUTHORIZED=0` disables verification process-wide; do not copy\nit into application configuration or production. It is unnecessary for fixture\u002Fmock-only tests.\n\n### Strip-only Node scripts\n\nA module-type\u002Freparse warning from running a TypeScript smoke script without `\"type\": \"module\"`\nis non-blocking. For an ESM test entrypoint in an otherwise CommonJS project use `.mts`, rather\nthan changing the whole app's module mode merely to silence it. Keep explicit interop for CJS\ndependencies; their presence alone does not require the entire project to be CommonJS.\n\n## Gotchas\n\n| Gotcha | Detail |\n|---|---|\n| ESM project (`\"type\": \"module\"`) | Playwright loads the `.ts` config + `globalSetup`\u002F`globalTeardown`\u002Ffixtures as ESM — a nested `tsconfig.json` `module: commonjs` does NOT change that. Both `require`\u002F`require.resolve` and `__dirname` → `ReferenceError: … is not defined in ES module scope` at config-parse. Pass setup as path strings, derive `__dirname` from `import.meta.url`, set the e2e tsconfig to `module: ESNext` + `moduleResolution: bundler` (see section above; from `jeswr\u002Fsolid-browser-extension`) |\n| `globalSetup` must be self-contained | Importing a sibling `.ts`\u002F`.mjs` from it trips Playwright's config transpiler in a CJS-default project — inline everything |\n| `node x.ts` strip-only mode | Rejects TS parameter properties — plain field assignments in files run directly with node |\n| Port clash | CSS owns `:3000`; the app runs on `:3200` (see config comments) |\n| Bare fresh profiles | Without the profile seed, `Agent.name` is `undefined` and `storageUrls` is empty — apps appear broken when it's just an unseeded pod |\n| ETag from CSS | Present and stable — exercise the conditional-PUT (`If-Match`\u002F`412`) path in tests; legacy NSS lacks it (see `solid-server-matrix`) |\n| PGlite boot cost | `new PGlite()` per test is ~1 s × N tests; boot once per vitest worker + reset schema between tests instead (see section above) |\n| Node 25.1 `localStorage` | `globalThis.localStorage` exists but throws on call unless `--localstorage-file` is set — a `typeof localStorage !== \"undefined\"` guard passes and then fails at call time, breaking SSR\u002Fprerender. Build on Node ≤24 or feature-detect by calling (see section above) |\n| Radix dropdowns won't open in jsdom | jsdom \u003C27 lacks `PointerEvent` (upgrade if you can), so `fireEvent.pointerDown` falls back to a generic `Event` whose `button` init is dropped — Radix triggers require `button === 0`, so the menu silently never opens. Use `fireEvent(trigger, new MouseEvent(\"pointerdown\", { bubbles: true }))` — the `MouseEvent` carries `button: 0`, and the `fireEvent(el, event)` form keeps the `act()` wrapping. Radix Select additionally checks `pointerType === \"mouse\"` (`Object.assign` it onto the event) and calls the pointer-capture APIs — stub `Element.prototype.{has,set,release}PointerCapture` in the test setup (see section above) |\n| Dependabot survives an upstream merge | Merging a fork's upstream does NOT clear Dependabot alerts (upstream ships the same vulnerable transitives) — clear them with range-scoped `pnpm-workspace.yaml` overrides, verified per alert (see section above) |\n","## Quick reference\n\n\u003C!-- AUTHORED-BY Codex GPT-6 -->\n\n\u003C!-- AUTHORED-BY Codex GPT-5 -->\n\n**Test Solid code against real protocol behavior**\n\nUse two layers:\n\n- Vitest for pure logic and data layers with injected fetch, clock, storage, crypto, and network seams.\n- Playwright or integration tests against one long-lived local Community Solid Server for actual HTTP, OIDC, DPoP, LDP, ETag, and browser behavior.\n\n### Harness rules\n\n- Start the server once per suite\u002Fworker, not once per test. Isolate writes with fresh accounts or pod roots.\n- Give CSS and the app distinct fixed ports. Probe the CSS account API rather than treating any HTTP 200 as the right service.\n- Seed fresh profiles with the WebID data tests require, including name and `pim:storage`; bare profiles make otherwise-correct application tests appear broken.\n- Use client-credentials DPoP fixtures for data arrangement. Keep one focused browser test for the real interactive popup path.\n- Before claiming an authenticated read worked, assert the resource is actually private with an anonymous 401\u002F403.\n- Pin the CSS version used in CI.\n- Never skip a non-completing login implicitly. A login timeout is a test failure unless an explicit opt-in skip is part of the test contract.\n- Avoid fixed sleeps. Wait on observable state, responses, or lifecycle seams.\n\n### Non-vacuous security tests\n\n- Drive real OAuth\u002FDPoP code over a stub transport rather than mocking away the library under test.\n- Verify signatures, `htm`\u002F`htu`, `ath`, `jkt`, nonce retry, token rotation, and replay behavior.\n- Exercise logout\u002Faccount-switch races and delayed stale operations.\n- For 401-budget tests, seed several private resources, count response statuses under the storage origin, and prove challenges do not scale per resource.\n- Match exact RDF namespace schemes in fixtures so a successful empty query cannot pass the test accidentally.\n\nIn ESM packages, keep Playwright config\u002Fsetup ESM-safe: use relative module paths, derive paths from `import.meta.url`, and avoid `require`\u002F`__dirname`. Keep test helpers reviewable text—write escaped separators rather than literal NUL bytes.\n\n### Agent persona\n\nWhen this work is delegated to a sub-agent, spawn the `solid-test-engineer` persona from\n[`.claude\u002Fagents\u002Fsolid-test-engineer.md`](..\u002F..\u002F.claude\u002Fagents\u002Fsolid-test-engineer.md) — it routes through this skill.\nOrchestration: `.claude\u002Fagents\u002Fsolid-app-orchestration.md`.\n\n\u003C!-- AUTHORED-BY Codex GPT-6.1-Sol -->\n\n# Solid test infrastructure — build it before the features\n\n**The test infrastructure is part of the scaffold, not an afterthought.** Stand it up right\nafter `create-next-app`, before the first feature — then every feature lands with its tests,\nand TDD is possible: write the failing test (unit or e2e), implement, go green, refactor.\n(Install the `test-driven-development` skill from `obra\u002Fsuperpowers` for the discipline; this\nskill is the Solid-specific machinery.)\n\nTwo layers, per [`AGENTS.md`](..\u002F..\u002FAGENTS.md) Part 2 §Testing:\n\n| Layer | Tool | Scope |\n|---|---|---|\n| Unit \u002F integration | **Vitest** | `src\u002Flib\u002F` — the data layer; `fetch` injected as an **optional** param, omitted in production paths |\n| End-to-end | **Playwright** | Golden paths against a **real local CSS** — login popup included; no mocks |\n\n## The bundled harness (execution-verified)\n\nTwo files, lifted verbatim from the clean-room verification build that validated this guide —\nthey powered full popup-login e2e runs (3\u002F3 stable) and authenticated write-path tests:\n\n1. **[`playwright.config.ts`](references\u002Fplaywright.config.ts.md)** — the two-`webServer` pattern: one\n   in-memory CSS@7 on `:3000` (it must own that port — the auth issuer map requires it) and the\n   app on `:3200` (`next dev` would otherwise clash on 3000; **using another framework, swap\n   that webServer command for your dev server on `:3200`** — the harness is framework-agnostic,\n   as is `dev.mjs` via `APP_CMD`). One CSS instance per suite — startup is ~13s, so never\n   per-test. `reuseExistingServer` keeps local iteration fast.\n2. **[`global-setup.ts`](references\u002Fglobal-setup.ts.md)** — runs once after the servers are up:\n   - creates a unique account and pod per run via the CSS account API (`POST \u002F.account\u002Faccount\u002F` with `{}` — with a\n     JSON content-type an empty body 500s), registers a password, creates the pod;\n   - mints **client-credentials**, then exchanges them for a **DPoP-bound token** (jose-built\n     proofs — note the `ath` claim on resource requests);\n   - **seeds the profile** — a fresh CSS pod profile has no `foaf:name` and no `pim:storage`\n     (so no display name and no write path); the setup PUTs them plus a photo;\n   - passes `{ webId, email, password, podRoot }` to test workers through\n     `process.env.SOLID_E2E_ACCOUNT`, without logging credentials.\n\n3. **[`css-account.ts`](references\u002Fcss-account.ts.md)** — the per-test account fixture:\n   `createCssAccount({ pod })` returns `{ webId, email, password, podRoot, token, proof }` with\n   the bare profile seeded — fresh-account-per-write-test isolation without restarting CSS\n   (compile-verified; same recipe as global-setup, packaged per call).\n\nCopy what you need; keep the unique per-run account names and consume the setup credentials\nin tests rather than hardcoding Alice. `jose` is the only\nextra dev-dependency. Alternative to run-time profile seeding: start CSS with the **custom pod\ntemplates** from this repo's `config\u002Fpod-templates\u002F` (+ `config\u002Fcss-memory-wac-templates.json`)\nand every pod is born with `pim:storage` — see `docs\u002Flocal-ops.md` for the verified mechanics\nand the `--seedConfig` boot-time account seeding.\n\n## The dev environment — seeded and ready to log in\n\n`npm run dev` must give the developer a **testable** environment, not just a compiling app:\nCSS running, accounts already seeded, and the **credentials printed where they can't be\nmissed**. The bundled [`dev.mjs`](references\u002Fdev.mjs.md) (execution-verified) does exactly that — starts\nin-memory CSS on `:3000`, seeds two accounts (alice\u002Fbob, profile names + `pim:storage`\nincluded), prints a credentials banner (WebID \u002F email \u002F password \u002F pod root per account), then\nstarts the app on `:3200`. Wire it as the dev script:\n\n```json\n{ \"scripts\": { \"dev\": \"node scripts\u002Fdev.mjs\" } }\n```\n\n`node scripts\u002Fdev.mjs --no-app` gives CSS + seeded accounts only — run it once in its own\nterminal and leave it up: **CSS takes ~15 s to boot, so avoid restarting it**. The script\nreuses a CSS already on `:3000` (tolerating existing accounts), so app restarts never pay the\nCSS boot cost. It detects that reuse by probing the CSS-specific account API\n(`GET \u002F.account\u002F` → JSON), **not** a bare `200` on `\u002F` — so a stray `next dev` (whose default\nport is also `3000`) won't be mistaken for CSS; if something non-CSS owns `:3000` the script\nfails fast with an `lsof -i :3000` hint instead of seeding against the wrong server. For clean\nstate, prefer a fresh account (`createCssAccount`) over a restart.\n\n## Patterns the harness enables\n\n- **Authenticated fixtures without the popup**: the client-credentials DPoP token from\n  global-setup reads\u002Fwrites the pod directly — use it to arrange test data and to test the\n  data layer against live CSS (fast, no browser). Interactive popup login stays in exactly one\n  or two e2e specs.\n- **401-gated assertions**: before asserting authenticated content, confirm the resource\n  returns `401` unauthenticated — then a passing test *proves* the auth upgrade ran; a false\n  pass is impossible.\n- **Write isolation**: in-memory CSS resets on restart; for a pristine pod per suite, restart\n  CSS. For write-heavy suites, `createCssAccount` (bundled) gives a fresh account + seeded\n  profile + DPoP token per test — no shared-pod interference, no restart.\n- **Popup flows**: capture the OIDC popup with `context.waitForEvent(\"page\")`; CSS login is\n  `#email` \u002F `#password` → \"Log in\" → \"Authorize\". Ignore the transient `prompt=none` popup\n  that closes itself before the interactive one opens.\n\n## Per-feature loop (the actual instruction)\n\nFor every feature: **(1)** write the failing Vitest case against the data-layer contract\n(mock `fetch` via the optional param), **(2)** implement until green, **(3)** extend — or\nconfirm coverage by — an e2e golden path. A feature without tests is not done. Don't\nsnapshot-test UI, don't test shadcn primitives, don't `sleep()` — auto-waits only.\n\n[`feature.spec.example.ts`](references\u002Ffeature.spec.example.ts.md) is the per-feature e2e template —\ndistilled from a real Bob-built TODO app developed against this guide: login error-states\nfirst (they're the executable form of the `solid-reactive-authentication` UX spec), a\nshared popup-login helper in `beforeEach` (email\u002Fpassword and consent), role\u002Fplaceholder locators, empty-state → create → persist-across-reload.\n\n## PGlite-backed services — boot once per worker, reset between tests\n\nWhen testing a Postgres-backed Solid service with\n[`@electric-sql\u002Fpglite`](https:\u002F\u002Fgithub.com\u002Felectric-sql\u002Fpglite) (in-process WASM Postgres) under\nvitest, **do NOT `new PGlite()` per test or per suite** — the WASM boot takes ~1 s each and\nparallel boots thrash CPU, forcing long test timeouts and slow suites. Instead **boot one engine\nper vitest worker and reset the schema (~80 ms) between tests** (drop + recreate or truncate).\n\nIn `jeswr\u002Fsolid-webid-index` this cut the suite from ~683 s cumulative \u002F ~123 s wall-clock to\n~90 s \u002F ~16 s (≈7.5×) and removed the need for inflated per-test timeouts.\n\n**Pattern:**\n\n```ts\n\u002F\u002F test\u002Fhelpers\u002Fdb.ts  (imported by every test file)\nimport { PGlite } from \"@electric-sql\u002Fpglite\";\n\n\u002F\u002F Kick off the WASM boot immediately at module load so it overlaps vitest's import phase.\nconst enginePromise = PGlite.create();\n\nexport async function freshDb(): Promise\u003CPGlite> {\n  const db = await enginePromise;\n  \u002F\u002F Drop and recreate the schema — ~80 ms vs ~1 s for a new engine.\n  await db.exec(\"DROP SCHEMA public CASCADE; CREATE SCHEMA public;\");\n  await runMigrations(db);   \u002F\u002F your app's migration function\n  return db;\n}\n```\n\n```ts\n\u002F\u002F my-feature.test.ts\nimport { freshDb } from \".\u002Fhelpers\u002Fdb.js\";\n\nlet db: PGlite;\nbeforeEach(async () => { db = await freshDb(); });\n\u002F\u002F No afterAll close — the shared engine lives for the whole worker lifetime.\n```\n\nRules:\n- **Never `close()` the shared engine** mid-suite; it cannot be reopened.\n- Route every test through one shared `freshDb()` \u002F `freshTestStore()` helper — never call\n  `PGlite.create()` directly in a test file.\n- Each vitest worker gets its own engine (vitest isolates workers) so tests in different files\n  run truly in parallel without contention.\n\n## ESM project (`\"type\": \"module\"`) — Playwright loads the config + setup files as ESM\n\nIn a package with `\"type\": \"module\"` in `package.json`, **Playwright loads its `.ts` config AND\nthe imported `globalSetup`\u002F`globalTeardown`\u002Ffixture files as ESM** — regardless of a nested\n`e2e\u002Ftsconfig.json` set to `module: commonjs`. So a CJS-only construct in any of those files\nthrows at config-parse time (in CI, before a single test runs) — both `require` and `__dirname`\nare simply not defined in an ES module:\n\n- `require` \u002F `require.resolve(...)` → `ReferenceError: require is not defined in ES module scope`;\n- `__dirname` → `ReferenceError: __dirname is not defined in ES module scope`.\n\nFix:\n\n- in the Playwright config, pass `globalSetup`\u002F`globalTeardown` as plain **relative path strings**\n  (Playwright resolves them against the config dir) — not `require.resolve(...)`;\n- in the setup files, derive `__dirname` from `import.meta.url`:\n  ```ts\n  import { fileURLToPath } from \"node:url\";\n  import { dirname } from \"node:path\";\n  const __dirname = dirname(fileURLToPath(import.meta.url));\n  ```\n- set the e2e `tsconfig.json` to `module: ESNext` + `moduleResolution: bundler` so `import.meta`\n  is type-correct.\n\n(Learned fixing the `jeswr\u002Fsolid-browser-extension` e2e CI — the ESM-config fix. This is the\nESM-default mirror of the CJS-default `globalSetup` transpiler gotcha below.)\n\n## Node version — 25.1 breaks SSR\u002Fprerender via `localStorage`\n\nNode 25.1 ships `globalThis.localStorage` as a **truthy object whose methods are\nnon-functional** unless `--localstorage-file` is set. That silently breaks the standard\nbrowser-detection guard used to keep Solid client code (and any `localStorage`-touching code)\nout of the server render path:\n\n```ts\n\u002F\u002F Passes on Node 25.1 even though localStorage.getItem() then throws —\n\u002F\u002F the object exists, so `typeof` sees \"object\", not \"undefined\".\nif (typeof localStorage !== \"undefined\") {\n  const cached = localStorage.getItem(key); \u002F\u002F throws server-side\n}\n```\n\nUnder Next.js (or any SSR\u002Fprerender framework) this makes a page that only touches\n`localStorage` behind a `typeof` guard 500 at build\u002Fprerender time — on Node ≤24 the same guard\ncorrectly evaluates `false` server-side and skips the branch. This bit the `jeswr\u002Felk` fork's `\u002F`\nprerender.\n\nFix, in order of preference:\n- **Build\u002Fprerender on Node ≤24** — pin it (`.nvmrc` \u002F `package.json` `engines.node`) so CI and\n  every contributor's local build use a version where the guard behaves.\n- **Feature-detect by calling, not by `typeof`** — wrap the actual access in try\u002Fcatch instead of\n  trusting existence:\n  ```ts\n  function hasWorkingLocalStorage(): boolean {\n    try {\n      localStorage.setItem(\"__probe__\", \"1\");\n      localStorage.removeItem(\"__probe__\");\n      return true;\n    } catch {\n      return false;\n    }\n  }\n  ```\n- Do both — the `.nvmrc`\u002F`engines` pin keeps the whole toolchain (not just this one guard)\n  behaving consistently; the call-based probe is the defensive fallback for code you don't\n  control.\n\n(Learned in the `jeswr\u002Felk` fork upstream-sync, 2026-07-02 — verified by reproduction: the\n`typeof` guard passed and `\u002F` prerendered fine on Node 24, then 500'd on Node 25.1 with the exact\nsame source.)\n\n## jsdom + Radix UI — `fireEvent.pointerDown` never opens a dropdown\n\nRadix UI menu triggers (DropdownMenu and friends — the menus shadcn wraps) open from a\n`pointerdown` event whose `button === 0`. jsdom **before v27** has no `PointerEvent`\nconstructor (check `typeof window.PointerEvent`), so there Testing Library's\n`fireEvent.pointerDown` falls back to constructing a generic `Event` and the `MouseEvent`-init\nfields (`button`, `ctrlKey`, …) are silently dropped — `event.button` is `undefined`, Radix's\n`button === 0` trigger check fails, and the menu never opens. No error, no warning: the same\ncomponent works in a real browser, but under vitest\u002Fjsdom the menu content simply never appears\nin the document. (jsdom ≥27 implements `PointerEvent`, so upgrading removes the fallback path —\nthe workaround below is for environments pinned to an older jsdom.)\n\nFix: construct the `MouseEvent` yourself with `type: \"pointerdown\"` — jsdom implements\n`MouseEvent` fully and it carries `button: 0` by default — and dispatch it **through\n`fireEvent(element, event)`** so Testing Library still wraps the dispatch in React's `act()`\n(a raw `element.dispatchEvent(...)` skips that and can leave you asserting before the\nresulting state updates settle, with act warnings):\n\n```ts\n\u002F\u002F fireEvent.pointerDown(trigger);  \u002F\u002F ✗ generic Event in jsdom — button undefined, no open\nfireEvent(trigger, new MouseEvent(\"pointerdown\", { bubbles: true })); \u002F\u002F ✓ button: 0 — opens\n```\n\nVerified on dropdown menus. Radix **Select** triggers additionally check\n`event.pointerType === \"mouse\"`, which a bare `MouseEvent` also lacks — if a Select still won't\nopen, attach the field to the constructed event first:\n\n```ts\nfireEvent(\n  trigger,\n  Object.assign(new MouseEvent(\"pointerdown\", { bubbles: true }), { pointerType: \"mouse\" }),\n);\n```\n\nSelect also calls the element pointer-capture APIs, which pre-27 jsdom doesn't implement\neither — stub them once in the vitest setup file or the Select tests still throw \u002F stay shut:\n\n```ts\nif (!Element.prototype.hasPointerCapture) {\n  Element.prototype.hasPointerCapture = () => false;\n  Element.prototype.setPointerCapture = () => {};\n  Element.prototype.releasePointerCapture = () => {};\n}\n```\n\n(Learned writing component tests for the suite apps' shadcn\u002FRadix dropdown menus, 2026-07 —\nbead suite-tracker-z7cc. The tell: a dropdown that opens fine in the browser but whose items\nare unreachable in jsdom tests.)\n\n## Clearing a Dependabot backlog in a fork — range-scoped pnpm overrides\n\nWhen syncing an OSS app fork with its upstream, **merging upstream does not clear your\nDependabot alerts** — upstream usually carries the same vulnerable transitive dependencies, so\nthe alerts survive the merge unchanged. To clear a backlog without waiting on upstream:\n\n- Use `pnpm-workspace.yaml` `overrides` in **range-selector form**, scoped to only the vulnerable\n  major (e.g. `\"vulnerable-pkg@^3\": \"^3.2.1\"`), not a blanket pin — a blanket override can drag in\n  an incompatible major and silently break every parallel-major dependent left untouched by the\n  advisory.\n- **Verify the patched version actually exists on npm before writing the override** — an override\n  pointing at a version that was never published leaves `pnpm install` unresolvable.\n- **Regenerate and re-verify the lockfile per alert** — check each Dependabot alert against the\n  regenerated lockfile individually rather than assuming one override run clears all of them.\n- **pnpm ≥11 footgun**: a git-hosted dependency with install\u002Fbuild scripts must be allowlisted by\n  its **exact tarball URL** in `pnpm.allowedDeprecatedVersions`\u002F`onlyBuiltDependencies`-style\n  config. If that dependency is pinned to a moving ref (e.g. `#main`), the allowlist entry breaks\n  every time the upstream ref advances — pin the git dependency by commit SHA, not a branch name,\n  so the allowlist entry stays valid.\n\n(Learned in the `jeswr\u002Felk` fork upstream-sync, 2026-07-02 — each fix verified per-alert against\nthe regenerated lockfile.)\n\n## Pitfalls\n\n### Minimal live round-trip proof\n\n> In the NOTES broker\u002FRS fixture, use `https:\u002F\u002Flocalhost:3000` for requests when that is the\n> configured public URL, TLS hostname, and `PSS_TOKEN_AUDIENCE`. Route TCP to IPv4 separately.\n> DPoP `htu` covers the target URI without query\u002Ffragment; it is not the TCP bind address.\n\nFor an explicitly authorized local\u002Fdisposable integration environment, separate a **minimal\nlive round-trip proof** from the **full UI smoke test**. The minimal proof avoids popup\u002FCOOP\ncoupling, but does not test the app's login UI:\n\n1. Register a test client from Node if the local broker supports dynamic registration.\n2. Navigate the browser's main page to the authorization endpoint using PKCE, state and nonce.\n3. Complete the local identity-provider login and broker consent on that page.\n4. Wait for the exact callback origin\u002Fpath and validate the returned state before taking the code.\n5. Exchange the code from Node for a DPoP-bound token with the same key\u002FPKCE verifier and\n   validate the token response.\n6. PUT, GET and DELETE a unique app-owned test resource, asserting statuses and round-trip data.\n   Confirm anonymous access is denied so success proves authentication.\n\nKeep the popup-driven test as full UI coverage. For work restricted to fixtures\u002Fmocks, exercise\nthe same protocol steps over stub transports; this pattern does not authorize a live service run.\n\n### Broker consent and COOP\n\nInspect the broker's rendered form rather than guessing consent fields. In the NOTES broker,\n`POST \u002Finteraction\u002Fconfirm` uses `decision=accept`; `accept=true` re-presents consent despite\nan HTTP success. Preserve the form's action and hidden\u002FCSRF fields. This is a deployment detail,\nnot a standard OIDC consent form contract.\nIf a popup returns to the callback with no `window.opener`, inspect broker\n`Cross-Origin-Opener-Policy: same-origin`; the reported symptom was a `login_required` callback,\nno second popup, and a hung flow. Prefer the main-page proof above for protocol diagnosis.\nThe source's Chromium flags disabling web security\u002FCOOP are not a production fix and do not\nprove normal browser login works. Test any alternative callback transport (such as\nBroadcastChannel) with the same origin\u002Fstate protections; do not weaken broker headers globally.\n\n### Self-signed TLS in Node workers\n\nNode's built-in fetch uses Undici; `https.Agent` passed as `agent` does not configure it.\nFor local test certificates, prefer trusting the test CA. Where an isolated disposable test\nrequires a bypass, scope it to that local request using an explicitly installed `undici` fetch\nand `Agent` dispatcher, and close the dispatcher afterward. Node bundling Undici internally\ndoes not make `import \"undici\"` available without declaring the dependency.\nThe source's `NODE_TLS_REJECT_UNAUTHORIZED=0` disables verification process-wide; do not copy\nit into application configuration or production. It is unnecessary for fixture\u002Fmock-only tests.\n\n### Strip-only Node scripts\n\nA module-type\u002Freparse warning from running a TypeScript smoke script without `\"type\": \"module\"`\nis non-blocking. For an ESM test entrypoint in an otherwise CommonJS project use `.mts`, rather\nthan changing the whole app's module mode merely to silence it. Keep explicit interop for CJS\ndependencies; their presence alone does not require the entire project to be CommonJS.\n\n## Gotchas\n\n| Gotcha | Detail |\n|---|---|\n| ESM project (`\"type\": \"module\"`) | Playwright loads the `.ts` config + `globalSetup`\u002F`globalTeardown`\u002Ffixtures as ESM — a nested `tsconfig.json` `module: commonjs` does NOT change that. Both `require`\u002F`require.resolve` and `__dirname` → `ReferenceError: … is not defined in ES module scope` at config-parse. Pass setup as path strings, derive `__dirname` from `import.meta.url`, set the e2e tsconfig to `module: ESNext` + `moduleResolution: bundler` (see section above; from `jeswr\u002Fsolid-browser-extension`) |\n| `globalSetup` must be self-contained | Importing a sibling `.ts`\u002F`.mjs` from it trips Playwright's config transpiler in a CJS-default project — inline everything |\n| `node x.ts` strip-only mode | Rejects TS parameter properties — plain field assignments in files run directly with node |\n| Port clash | CSS owns `:3000`; the app runs on `:3200` (see config comments) |\n| Bare fresh profiles | Without the profile seed, `Agent.name` is `undefined` and `storageUrls` is empty — apps appear broken when it's just an unseeded pod |\n| ETag from CSS | Present and stable — exercise the conditional-PUT (`If-Match`\u002F`412`) path in tests; legacy NSS lacks it (see `solid-server-matrix`) |\n| PGlite boot cost | `new PGlite()` per test is ~1 s × N tests; boot once per vitest worker + reset schema between tests instead (see section above) |\n| Node 25.1 `localStorage` | `globalThis.localStorage` exists but throws on call unless `--localstorage-file` is set — a `typeof localStorage !== \"undefined\"` guard passes and then fails at call time, breaking SSR\u002Fprerender. Build on Node ≤24 or feature-detect by calling (see section above) |\n| Radix dropdowns won't open in jsdom | jsdom \u003C27 lacks `PointerEvent` (upgrade if you can), so `fireEvent.pointerDown` falls back to a generic `Event` whose `button` init is dropped — Radix triggers require `button === 0`, so the menu silently never opens. Use `fireEvent(trigger, new MouseEvent(\"pointerdown\", { bubbles: true }))` — the `MouseEvent` carries `button: 0`, and the `fireEvent(el, event)` form keeps the `act()` wrapping. Radix Select additionally checks `pointerType === \"mouse\"` (`Object.assign` it onto the event) and calls the pointer-capture APIs — stub `Element.prototype.{has,set,release}PointerCapture` in the test setup (see section above) |\n| Dependabot survives an upstream merge | Merging a fork's upstream does NOT clear Dependabot alerts (upstream ships the same vulnerable transitives) — clear them with range-scoped `pnpm-workspace.yaml` overrides, verified per alert (see section above) |\n",{"name":5,"description":7},"main","5482abfe2666cc12f835fe360e8fad1f1e1dea8c","skills\u002Fsolid-test-infrastructure",0,"https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk","https:\u002F\u002Fgithub.com\u002Fjeswr","jeswr.org\u002F#me","@solid Lead @theodi | PhD Candidate @OxfordHCC\r\n\r\n","2026-11-15 05:20:24",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add jeswr\u002Fsolid-sdk --skill solid-test-infrastructure",{"tool":39,"command":40},"bunx","bunx skills add jeswr\u002Fsolid-sdk --skill solid-test-infrastructure",{"tool":42,"command":43},"pnpm","pnpm dlx skills add jeswr\u002Fsolid-sdk --skill solid-test-infrastructure","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fsolid-test-infrastructure\u002FSKILL.md",true,[47,53,57,61,65],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fcss-account.ts.md","REFERENCE","参考文档",5829,"https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fsolid-test-infrastructure\u002Freferences\u002Fcss-account.ts.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Fdev.mjs.md",9126,"https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fsolid-test-infrastructure\u002Freferences\u002Fdev.mjs.md",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Ffeature.spec.example.ts.md",5261,"https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fsolid-test-infrastructure\u002Freferences\u002Ffeature.spec.example.ts.md",{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fglobal-setup.ts.md",5550,"https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fsolid-test-infrastructure\u002Freferences\u002Fglobal-setup.ts.md",{"path":66,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fplaywright.config.ts.md",1634,"https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fsolid-test-infrastructure\u002Freferences\u002Fplaywright.config.ts.md",[70,77,84,91,98,105],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M78FNRF6EV6SKPEYRZ6JTTQ3","storage-conformance","Work on @jeswr\u002Fstorage-conformance, the shared storage conformance suite package in the Solid SDK workspace.","https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Ftools\u002Fstorage-conformance\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M78FNMS7HQGD9EE43WAFEW6A","fetch-rdf-engine-tests","Maintain fetch-rdf's real Node WASM parser integration tests without introducing a reverse engine dependency in fetch-rdf.","https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Ftools\u002Ffetch-rdf-engine-tests\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M78FNK5M6ASAR3909JT6BZV1","alpha","Use when checking fixtures, including folded YAML descriptions.","https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fcheck-skills\u002Fvalid\u002Fskills\u002Falpha\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M78FNGATR8F4N09HWSFVWBAF","widget","Use when testing package skills: YAML quoting works.","https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fcheck-skills\u002Fvalid\u002Fpackages\u002Fwidget\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M78FN9M05GCHYTK848SSMN9R","web-seo","Use when improving technical and entity SEO for a modern personal, portfolio, documentation, or marketing site, including crawlable HTML, canonical metadata, sitemap and robots, Person\u002FProfilePage JSON-LD, Core Web Vitals, and honest ranking expectations.","https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fweb-seo\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":19},"01M78FN5ANETMSPMEFACSJ7JMC","solid-wac","Use when implementing or auditing Solid server WAC authorization, ACL creation and inheritance, auxiliary-resource escalation, method-to-mode mapping, 401 versus 403 challenges, WAC-Allow, or defensive typed ACL parsing with @solid\u002Fobject and @rdfjs\u002Fwrapper.","https:\u002F\u002Fgithub.com\u002Fjeswr\u002Fsolid-sdk\u002Fblob\u002Fmain\u002Fskills\u002Fsolid-wac\u002FSKILL.md",[],[]]