Skip to content

fix(typescript): resolve relative imports from transpiled .ts test files - #452

Merged
ngarbezza merged 2 commits into
mainfrom
fix/450-ts-relative-imports
Oct 28, 2026
Merged

ngarbezza merged 2 commits into
mainfrom
fix/450-ts-relative-imports

Conversation

@ngarbezza

Copy link
Copy Markdown
Owner

Closes #450

Problem

Since 8.1.0 the transpiled copy of a .ts test was written to <cwd>/.testy-cache/ and imported from there, so relative specifiers like ./suma.ts resolved against .testy-cache/ and failed with ERR_MODULE_NOT_FOUND.

Fix

The temporary JS file is now written next to the original (<name>.ts.testy-tmp.js), so relative imports resolve against the same directory. It is still deleted after loading. .testy-cache is no longer created; the .gitignore entry is kept and the new temp pattern added.

The .ts extension in specifiers is not rewritten: it relies on Node's native type stripping (>= 22.18) to load the imported .ts modules, as in 8.0.0.

Tests

New TestFileLoader test with fixtures: a .ts file importing a sibling .ts module (failed before the fix). npm test, npm run lint and the Simplicity Guardian pass locally.

🤖 Generated with Claude Code

…ve imports resolve

Closes #450

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@aviator-app

aviator-app Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged manually (without Aviator). Merging manually can negatively impact the performance of the queue. Consider using Aviator next time.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ngarbezza
ngarbezza merged commit 9ed9706 into main Oct 28, 2026
6 checks passed
@ngarbezza
ngarbezza deleted the fix/450-ts-relative-imports branch October 28, 2026 19:55
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.

.ts test files that import local modules fail to load since 8.1.0 (transpiled copy in .testy-cache breaks relative imports)

1 participant