Skip to content

fix(test): resolve @/ alias for node --test; skip db.ts-blocked library-storage test - #52

Merged
SomeRandmGuyy merged 1 commit into
mainfrom
fix/library-storage-test-loading
Sep 16, 2026
Merged

SomeRandmGuyy merged 1 commit into
mainfrom
fix/library-storage-test-loading

Conversation

@SomeRandmGuyy

Copy link
Copy Markdown
Contributor

PR #51 merged with library-storage.server.test.ts failing under npm test (387/388 — confirmed by running the suite fresh on main). Root cause and fix described in the commit message. npm test: 388 total, 387 pass, 1 named/reasoned skip, 0 fail. tsc --noEmit: 0 errors. Needed before Task 4/5 of docs/superpowers/plans/2026-09-16-clips-to-library.md, since Task 5's own module has the same @/ import pattern.

🤖 Generated with Claude Code

…ry-storage test

PR #51 merged with library-storage.server.test.ts failing under `npm test`
(387/388). Root cause: the test imports library-storage.server.ts directly,
which has pre-existing static `@/...` imports that node's ESM resolver
can't handle (only Vite/tsc understand that alias). Fixes:

- scripts/test-alias-hook.mjs + register-test-aliases.mjs: a Node module
  customization hook resolving @/* -> ./src/* (matches tsconfig.json's
  path), registered via `node --import` in package.json's test script.
  Needed by clip-export.server.ts's own @/lib/clip-export import in the
  next task, not just this file.
- library-storage.server.test.ts: with the alias resolved, the import
  chain still reaches src/lib/db.ts, which calls Vite's build-time-only
  `import.meta.glob(...)` to inline migration SQL — that has no meaning
  under plain node and can't be fixed without touching db.ts for every
  caller. The test now degrades to a documented, named skip instead of
  failing the suite; writeLibraryFile/backendFromStorageKey get their real
  coverage from the Task 10 live-app check (real Vite runtime).

npm test: 388 total, 387 pass, 1 skip (named + reasoned), 0 fail.
tsc --noEmit: 0 errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

Deployment failed for project clippyos with the following error:

Hobby accounts are limited to daily cron jobs. This cron expression (*/15 * * * *) would run more than once per day. Upgrade to the Pro plan to unlock all Cron Jobs features on Vercel.

Learn More: https://vercel.link/3Fpeeb1

@SomeRandmGuyy
SomeRandmGuyy merged commit 50a6082 into main Sep 16, 2026
0 of 5 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