Skip to content

fix(test): make the Deno tRPC suite loadable (#480) - #498

Merged
thinkclay merged 1 commit into
mainfrom
claude/deno-trpc-test-loading
Jul 30, 2026
Merged

thinkclay merged 1 commit into
mainfrom
claude/deno-trpc-test-loading

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Closes #480.

deno test resolves every matching file before running any of them, so one bad
specifier takes the whole directory down. This one produced zero test signal:

error: Module not found "https://deno.land/[email protected]/assert/mod".

Three causes, all the same shape

A missing extension — which Deno requires and Node does not.

14 files imported .../assert/mod without .ts (the one named in #480)
45 imports across 26 files relative imports omitting .ts, or /index.ts for directory imports
1 file notifications-preferences.test.ts imported the appRouter value from routers/_app.ts

That last one is worth a note: _app.ts re-exports only the AppRouter type by
design — the value/type split exists to dodge TS4023, and the runtime instance lives in
_app-impl.ts. It surfaced only once the module graph loaded far enough to evaluate it,
which is exactly the kind of second-order breakage a dark directory hides.

Verification

The same parse/load probe scripts/prepush.sh uses — a filter matching nothing, so every
file is resolved and evaluated but no test body runs:

deno test --allow-all --no-check --config=functions/trpc/deno.json \
  --filter '__load_probe_matches_nothing__' functions/trpc/__tests__/
before:  error: Module not found          0 tests discovered
after:   ok                              237 tests discovered, 0 load failures

Whether those 237 pass is a separate question — they need a live Supabase, and
#411 / #478 track their state. This PR is only about the directory loading at all.

Also probed the sibling suite (packages/supabase/tests/, 390 tests) — it already loads,
no equivalent breakage there.

Deliberately not changed

The std version split (11 files on 0.208.0, 4 on 0.218.0). Untidy, but it isn't the
bug, and unifying it changes which assertion implementations run — that deserves its own
PR with its own verification.

Note on CI

Actions is out of included minutes until the allowance resets on the 1st, so this is
verified locally only. The load probe above is the same check CI would run, and it's
deterministic — no live services involved.

🤖 Generated with Claude Code

`deno test` resolves every matching file before running any of them, so a
single bad specifier takes the whole directory down. This one produced
**zero** test signal:

  error: Module not found "https://deno.land/[email protected]/assert/mod".

Three distinct causes, all the same shape — a missing extension, which Deno
requires and Node does not:

1. 14 files imported `.../assert/mod` without `.ts`.
2. 45 relative imports across 26 files omitted `.ts` (or `/index.ts` for
   directory imports).
3. notifications-preferences.test.ts imported the `appRouter` *value* from
   `routers/_app.ts`, which by design re-exports only the `AppRouter` type —
   the value/type split exists to dodge TS4023, and the instance lives in
   `_app-impl.ts`. That one surfaced only once the module graph loaded far
   enough to evaluate it.

Verified with the same parse/load probe scripts/prepush.sh uses — a filter
matching nothing, so every file is resolved and evaluated but no test body
runs:

  deno test --allow-all --no-check --config=functions/trpc/deno.json \
    --filter '__load_probe_matches_nothing__' functions/trpc/__tests__/

  before: error, 0 tests discovered
  after:  ok, 237 tests discovered, 0 load failures

Whether those 237 pass is a separate question — they need a live Supabase, and
#411/#478 track their state. This change is only about the directory loading
at all.

Also probed the sibling suite (packages/supabase/tests/, 390 tests) — it
already loads; no equivalent breakage there.

Not changed: the std version split (11 files on 0.208.0, 4 on 0.218.0). It is
untidy but not the bug, and unifying it changes which assertion
implementations run — worth its own PR with its own verification.

Co-Authored-By: Claude Opus 5 <[email protected]>
@thinkclay
thinkclay merged commit 97a2fa0 into main Jul 30, 2026
4 of 6 checks passed
@thinkclay
thinkclay deleted the claude/deno-trpc-test-loading branch July 30, 2026 18:41
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.

deno: 14 trpc test files import assert/mod without .ts, so the whole directory fails to load

1 participant