Skip to content

πŸ› fix(test): run tests via tsx loader (fixes broken node --test) + add CI#1

Merged
kud merged 1 commit into
mainfrom
fix/test-runner-and-ci
Jul 5, 2026
Merged

πŸ› fix(test): run tests via tsx loader (fixes broken node --test) + add CI#1
kud merged 1 commit into
mainfrom
fix/test-runner-and-ci

Conversation

@kud

@kud kud commented Jul 5, 2026

Copy link
Copy Markdown
Owner

What

Fixes a broken test setup that produced 0 passing tests on a clean checkout, then adds CI.

The bug

test was node --test. The test/*.test.ts files import ../src/*.js (NodeNext .js specifiers), but Node's native TypeScript execution does not remap a .js specifier onto a sibling .ts file the way tsc/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 both dist/test/*.js and the original test/*.ts, double-running.

The fix

"test": "node --import tsx --test 'test/**/*.test.ts' 'test/**/*.test.tsx'"

tsx (already a devDependency) remaps the .js→.ts specifiers and handles .tsx; the explicit source globs keep discovery off dist/. This also runs the ui-app.test.tsx Ink test that default discovery was silently skipping — 34 tests now run, all green.

Also

New .github/workflows/ci.yml running build + test on PRs and pushes to main, matching the sibling release.yml (actions/checkout@v4, actions/setup-node@v4, node 22, npm ci + cache).

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.
@kud kud marked this pull request as ready for review July 5, 2026 02:21
@kud kud merged commit 9006da9 into main Jul 5, 2026
1 check passed
@kud kud deleted the fix/test-runner-and-ci branch July 5, 2026 02:21
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