Spawned from the coverage analysis right after the chat-sample
sweep. This is the single highest-leverage improvement we
identified — it lifts ~19 framework files from ~50 % coverage to
~85 % without writing a single new test.
The gap
Today bun test is the only test runner CI invokes. That leaves
the runtime-adapter files measured against zero exercise:
| file |
line coverage |
src/runtime/tcp/DenoTcpBackend.ts |
2 % |
src/runtime/http/DenoHonoRunner.ts |
5 % |
src/worker/WorkerNode.ts |
5 % |
src/runtime/tcp/NodeTcpBackend.ts |
6 % |
src/worker/WorkerCluster.ts |
7 % |
src/runtime/http/NodeHonoRunner.ts |
7 % |
src/runtime/sqlite/BetterSqliteDriver.ts |
27 % |
src/runtime/worker/NodeWorkerBackend.ts |
32 % |
src/runtime/http/index.ts, sqlite/index.ts, tcp/index.ts |
59 % each |
src/runtime/sqlite/BunSqliteDriver.ts |
67 % |
These aren't dead branches. The runtime-detection layer
(src/runtime/detect.ts) picks the correct backend at boot time
based on which globals exist. When the test suite runs in Bun,
the Node + Deno code paths get statically imported (for type
side-effects) but are never executed.
Scope
- Add a CI matrix step that re-runs the existing test suite under
Node and Deno in addition to Bun. Reuse the same test/ tree —
no test-code changes required. Recommended shape:
strategy:
matrix:
runtime: [bun, node, deno]
with three corresponding run: lines (the existing
package.json already has smoke:bun / smoke:node /
smoke:deno, so the runners are already proven to work in all
three — extending that to the full suite is the next step).
- For Node, prefer
node --test (built-in) or run via
bunx vitest / bunx tsx — needs investigation; the suite uses
bun:test's globals so a thin shim or Vitest-import remap is
likely needed.
- For Deno,
deno test --node-modules-dir may be the smoothest
path given existing npm:-style imports.
- Skip tests that legitimately don't apply to a runtime (e.g. a
BunSqliteDriver-specific test should skip under Node) via
runtime.is('bun') guards or describe-level
.skipIf(...) blocks.
- Update
README.md → "Compatibility" section to reflect what's
actually CI-verified.
Acceptance criteria
Out of scope
- Adding new tests. This issue is purely about exercising the
existing suite against more runtimes.
- Bun-specific perf tuning (e.g.
bun:sqlite vs Node SQLite
driver speeds) — separate concern.
Notes
The chat sample's smoke-test (examples/chat/smoke-test.ts)
already runs against all three runtimes via the smoke:* scripts.
That proves the cross-runtime story works end-to-end; the missing
piece is plumbing the unit suite into the same matrix.
Spawned from the coverage analysis right after the chat-sample
sweep. This is the single highest-leverage improvement we
identified — it lifts ~19 framework files from ~50 % coverage to
~85 % without writing a single new test.
The gap
Today
bun testis the only test runner CI invokes. That leavesthe runtime-adapter files measured against zero exercise:
src/runtime/tcp/DenoTcpBackend.tssrc/runtime/http/DenoHonoRunner.tssrc/worker/WorkerNode.tssrc/runtime/tcp/NodeTcpBackend.tssrc/worker/WorkerCluster.tssrc/runtime/http/NodeHonoRunner.tssrc/runtime/sqlite/BetterSqliteDriver.tssrc/runtime/worker/NodeWorkerBackend.tssrc/runtime/http/index.ts,sqlite/index.ts,tcp/index.tssrc/runtime/sqlite/BunSqliteDriver.tsThese aren't dead branches. The runtime-detection layer
(
src/runtime/detect.ts) picks the correct backend at boot timebased on which globals exist. When the test suite runs in Bun,
the Node + Deno code paths get statically imported (for type
side-effects) but are never executed.
Scope
Node and Deno in addition to Bun. Reuse the same
test/tree —no test-code changes required. Recommended shape:
run:lines (the existingpackage.jsonalready hassmoke:bun/smoke:node/smoke:deno, so the runners are already proven to work in allthree — extending that to the full suite is the next step).
node --test(built-in) or run viabunx vitest/bunx tsx— needs investigation; the suite usesbun:test's globals so a thin shim or Vitest-import remap islikely needed.
deno test --node-modules-dirmay be the smoothestpath given existing
npm:-style imports.BunSqliteDriver-specific test should skip under Node) viaruntime.is('bun')guards or describe-level.skipIf(...)blocks.README.md→ "Compatibility" section to reflect what'sactually CI-verified.
Acceptance criteria
src/runtime/**/*.tsrises to ≥ 85 %.src/worker/**/*.tsrises to ≥ 85 %.that just happen to be flaky under a specific runtime —
diagnose those individually).
Out of scope
existing suite against more runtimes.
bun:sqlitevs Node SQLitedriver speeds) — separate concern.
Notes
The chat sample's smoke-test (
examples/chat/smoke-test.ts)already runs against all three runtimes via the
smoke:*scripts.That proves the cross-runtime story works end-to-end; the missing
piece is plumbing the unit suite into the same matrix.