Repository navigation
fix(test): make the Deno tRPC suite loadable (#480) - #498
Merged
Merged
Conversation
`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]>
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.
Closes #480.
deno testresolves every matching file before running any of them, so one badspecifier takes the whole directory down. This one produced zero test signal:
Three causes, all the same shape
A missing extension — which Deno requires and Node does not.
.../assert/modwithout.ts(the one named in #480).ts, or/index.tsfor directory importsnotifications-preferences.test.tsimported theappRoutervalue fromrouters/_app.tsThat last one is worth a note:
_app.tsre-exports only theAppRoutertype bydesign — 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.shuses — a filter matching nothing, so everyfile is resolved and evaluated but no test body runs:
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 on0.218.0). Untidy, but it isn't thebug, 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