Repository navigation
Description
Actual vs expected
deno test cannot load packages/supabase/functions/trpc/__tests__/ at all:
error: Module not found "https://deno.land/[email protected]/assert/mod".
at .../functions/trpc/__tests__/document-cache.test.ts:12:8
14 files in that directory import the assert module without its .ts extension:
} from 'https://deno.land/[email protected]/assert/mod'; // wrong
} from 'https://deno.land/[email protected]/assert/mod.ts'; // correctDeno requires the explicit extension for remote specifiers. Because deno test resolves every matching file before running any of them, one bad specifier aborts the entire directory — so this layer currently produces zero test signal.
Expected: the directory loads and its suites run.
Why this survived
This is the same class of failure as #416/#418 (mismatched quotes aborting a whole run), and it hides in the same blind spot. The prepush parse probe added in scripts/prepush.sh only covers:
npx deno test ... --filter '__prepush_load_probe__' tests/unit/ tests/routers/functions/trpc/__tests__/ is not in that list, so this never trips prepush. Worth extending the probe as part of the fix, otherwise the next breakage here is equally invisible.
Where to look
packages/supabase/functions/trpc/__tests__/— 14 files; find them with:grep -rln "assert/mod['\"]" packages/supabase/functions/trpc/__tests__/scripts/prepush.sh— the load probe that should have caught it
Acceptance criteria
- Append
.tsto theassert/modspecifier in all 14 files. -
deno test --allow-all --no-check --no-lock --config tests/deno.json --filter '__probe__' functions/trpc/__tests__/exits 0 (the whole directory loads). - Extend the prepush probe to cover
functions/trpc/__tests__/alongsidetests/unit/andtests/routers/. - Report how many of these suites actually pass once they can run — expect further real failures behind this, as happened in fix(supabase): repair mismatched-quote syntax errors in 8 test files #419.
Context
Found while triaging #419, which fixed mismatched-quote syntax errors in 3 files in this directory. Those fixes are correct and merged, but the directory still cannot load because of this separate, pre-existing bug — so #419 alone does not restore test signal here.
Activity
fix(test): make the Deno tRPC suite loadable (#480) (#498)