π fix(test): run tests via tsx loader (fixes broken node --test) + add CI#1
Merged
Conversation
Add a GitHub Actions CI workflow that runs on push to main and on pull requests. The workflow installs dependencies via npm ci, builds the project, and runs tests on Node 22. Also updates the test script to use tsx for TypeScript test file resolution, targeting test/**/*.test.ts and test/**/*.test.tsx explicitly.
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.
What
Fixes a broken test setup that produced 0 passing tests on a clean checkout, then adds CI.
The bug
testwasnode --test. Thetest/*.test.tsfiles import../src/*.js(NodeNext.jsspecifiers), but Node's native TypeScript execution does not remap a.jsspecifier onto a sibling.tsfile the waytsc/bundlers do β so 6 of 7 test files errored at module resolution. Building first only made it worse:node --test's default discovery then picked up bothdist/test/*.jsand the originaltest/*.ts, double-running.The fix
tsx(already a devDependency) remaps the.jsβ.tsspecifiers and handles.tsx; the explicit source globs keep discovery offdist/. This also runs theui-app.test.tsxInk test that default discovery was silently skipping β 34 tests now run, all green.Also
New
.github/workflows/ci.ymlrunning build + test on PRs and pushes tomain, matching the siblingrelease.yml(actions/checkout@v4,actions/setup-node@v4, node 22,npm ci+ cache).