fix(test): resolve @/ alias for node --test; skip db.ts-blocked library-storage test - #52
Merged
Merged
Conversation
…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>
|
Deployment failed for project clippyos with the following error: Learn More: https://vercel.link/3Fpeeb1 |
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.
PR #51 merged with
library-storage.server.test.tsfailing undernpm 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