Skip to content

Syntax errors in 8 test files (from #334) silently break Deno test suites for packages/supabase #418

Closed

Description

@thinkclay

Summary

Nightly regression run on main (ee96fd40e) found that 8 test files under packages/supabase contain string-literal syntax errors (mismatched quote characters, e.g. '...text 'nested' more" — opens with ', has an unescaped inner ', closes with "). Because Deno's deno test parses every matching file in a glob before running any of them, a single broken file aborts the entire run with a SyntaxError before any test executes.

All 8 files were last touched by the same commit, 5473d98b3 ("fix(ui): onboarding error toast + JobForm draft floor + typed submit params (SC-112, SC-123, SC-124)", #334, 2026-06-09) — over 6 weeks ago. None of the affected suites are wired into CI (see below), so this has produced zero test signal since that commit landed.

Affected files

File Line(s)
packages/supabase/tests/routers/background-checks-disputes.test.ts 101
packages/supabase/tests/routers/ccpa.test.ts 231
packages/supabase/tests/routers/personality-assessment.test.ts 52
packages/supabase/tests/unit/ccpa-gpc.test.ts 61, 492
packages/supabase/tests/unit/ccpa-notifications.test.ts 422
packages/supabase/tests/unit/ccpa-pdf-generator.test.ts 356
packages/supabase/functions/trpc/__tests__/map-functions.test.ts 435, 491
packages/supabase/functions/trpc/__tests__/profile-experience.test.ts 215-217
packages/supabase/functions/trpc/__tests__/universities.test.ts 51-52, 99, 125, 128, 130-131

Examples:

// tests/routers/ccpa.test.ts:231
correctionDetails: 'Please update my profile name from 'Test' to "Updated Test"',

// tests/routers/personality-assessment.test.ts:52
type IPIPDomain = "A" | "E' | 'N' | 'C' | 'O';

// functions/trpc/__tests__/map-functions.test.ts:435
'Job status should be 'open'",

Confirmed via deno test --config packages/supabase/tests/deno.json packages/supabase/tests (fails immediately with SyntaxError: Expected ',', got 'Test' etc.) and cross-checked with a standalone TypeScript-parser syntax pass over every *.test.ts under packages/supabase (87 files checked, these 8 are the only ones with parse errors).

Why this went unnoticed

  • packages/supabase/tests/routers/** and packages/supabase/tests/unit/** are run via the root test:deno script, which isn't invoked by any GitHub Actions workflow.
  • packages/supabase/functions/trpc/__tests__/** is run via test:endpoints (functions/trpc/__tests__/run-tests.sh), also not invoked by any workflow.
  • .github/workflows/api-tests.yml only runs functions/api/__tests__/routes/*.test.ts and functions/api/__tests__/integration/*.test.ts, which are unaffected.

So this whole layer of tRPC/router regression tests has had no CI signal at all since #334 merged, and has been fully broken (won't even parse) for that entire time.

Suggested fix

  1. Fix the mismatched quotes in the 9 locations above (all look like accidental quote-character swaps, not intentional escaping).
  2. Wire pnpm test:deno and pnpm test:endpoints (or equivalent) into CI so a repeat of this doesn't go unnoticed for weeks.

How this was found

Automated nightly regression task running against main in a scratch environment. HEAD matched origin/main exactly at the time of the run; no local changes were made (working tree left untouched per task constraints — this issue reports the finding rather than fixing it directly).

Activity

  1. thinkclay commented on Jul 30, 2026

    @thinkclay
    ContributorAuthor

    Fixed in 6c6e5be0a.

    Five files, not eight — the parser found six broken literals across background-checks-disputes, ccpa, ccpa-gpc (two), ccpa-notifications and ccpa-pdf-generator. All the same signature: opened with ', closed with ", or an unescaped inner quote.

    The report's core claim was right and understated: it wasn't only the syntax errors keeping these suites dark. Also required —

    Any one of those would have kept the suites at zero. Unit suite is now 104 passing, router suite type-checks clean.

    Two real defects surfaced once the tests ran — a flaky-not-wrong > vs >= boundary in isVerificationExpired, and a stale GPC source expectation that contradicted the DB enum. Both detailed in the commit.

    And the reason it went unnoticed for six weeks: pnpm prepush was nx build & nx test & wait && write-stamp. Bare wait returns 0 regardless of job status, so the stamp was written and "✅ Pre-push validated" printed even when nx reported "Failed tasks". Now in scripts/prepush.sh, waiting per pid, plus a load-check that catches this whole class — verified to fail on an injected parse error and pass when clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions