Repository navigation
fix(supabase): repair mismatched-quote syntax errors in 8 test files - #419
Conversation
Deno parses every file in a test glob before running any of them, so these 9 mismatched-quote string literals (opening with one quote char, closing with another, or an unescaped inner apostrophe) aborted the entire packages/supabase/tests and functions/trpc/__tests__ suites with a SyntaxError before a single test could execute. Fixes #416 and #418. Also corrects a stale assertion in ccpa-gpc.test.ts that expected GPC_CONFIG.SOURCE to be "gpc" — the real config (and the ccpa_opt_out_source DB enum in migration 140) uses "gpc_signal". That mismatch was invisible until the syntax error blocking the file was fixed. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPAY48vbsvdMCqNWy4EMiz
|
All 9 CI check failures on this PR ( Generated by Claude Code |
# Conflicts: # packages/supabase/tests/routers/ccpa.test.ts # packages/supabase/tests/unit/ccpa-gpc.test.ts
|
Rebased onto current Six of the nine files were already fixed on The three After the rebase all three pass One caveat on the stated outcomeThis does not yet make the trpc suite runnable. Loading the directory now fails on a different, pre-existing bug: 14 files in that directory import Note the prepush probe only covers |
Summary
Nightly regression runs (#416, #418) found that 9 string literals across 8 files under
packages/supabasehave mismatched or unescaped quote characters (e.g. a string that opens with', contains an unescaped inner', and closes with"). Becausedeno testparses every matching file in a glob before running any of them, a single broken file aborts the entire run with aSyntaxErrorbefore any test executes. That means the wholepackages/supabase/tests/**andfunctions/trpc/__tests__/**layers have produced zero test signal since the breaking commit (#334, 2026-06-09).This PR only fixes the quote-character bugs — no logic changes, no scope creep.
Files fixed
packages/supabase/tests/routers/background-checks-disputes.test.tspackages/supabase/tests/routers/ccpa.test.tspackages/supabase/tests/routers/personality-assessment.test.tspackages/supabase/tests/unit/ccpa-gpc.test.tspackages/supabase/tests/unit/ccpa-notifications.test.tspackages/supabase/tests/unit/ccpa-pdf-generator.test.tspackages/supabase/functions/trpc/__tests__/map-functions.test.tspackages/supabase/functions/trpc/__tests__/profile-experience.test.tspackages/supabase/functions/trpc/__tests__/universities.test.tsBonus fix (same file, trivial)
While verifying,
ccpa-gpc.test.ts's "Source identifier" test could finally execute (previously masked by the syntax error) and failed for real: it assertedGPC_CONFIG.SOURCE === "gpc", but the actual config (functions/trpc/routers/ccpa/gpc.ts:34) and theccpa_opt_out_sourceDB enum (migration140_req_3_ccpa_compliance.sql) both use"gpc_signal". Updated the test's expectation to match reality — one line, no production code touched.Verification
Deno isn't preinstalled in this sandbox; installed
deno 2.9.4to verify:deno check(parse + typecheck) on all 9 files: no syntax errors (previously failed immediately withSyntaxError: Expected ','...on every one of them).deno test --allow-all --no-check --unstable-sloppy-imports --config packages/supabase/tests/deno.json packages/supabase/tests/unit/ccpa-gpc.test.ts→ 28 passed, 0 failed (was 1 failed before this PR, once the syntax error was cleared — now genuinely fixed).pnpm supa start+pnpm supa functions serve api) to execute past setup — not available in this sandbox — but all now parse/typecheck cleanly and fail only on expectedECONNREFUSEDto127.0.0.1:54321, confirming the syntax bugs are resolved and no new ones were introduced.Out of scope (filed separately / left as-is)
pnpm test:denonorpnpm test:endpointsis wired into any GitHub Actions workflow — that's the second half of Syntax errors in 8 test files (from #334) silently break Deno test suites for packages/supabase #418's suggested fix and is a CI-config change, not a test-content fix. Leaving that for a follow-up so this PR stays small and reviewable.background-checks-disputes.test.tsalso fails withSyntaxError: The requested module '../shared/setup' does not provide an export named 'requireAuthSetup'once run standalone — a separate, pre-existing export mismatch unrelated to quoting. Not fixed here to keep this PR focused; worth a follow-up issue.Closes #416, closes #418.
Generated by Claude Code