Skip to content

packages/supabase: 3 CCPA unit test files have unescaped quotes, fail to parse under deno test #416

Closed

Description

@thinkclay

Summary

Running the Deno unit test suite for packages/supabase (pnpm test:deno, i.e. deno test --allow-all --config packages/supabase/tests/deno.json packages/supabase/tests) fails immediately with syntax errors in 3 files under packages/supabase/tests/unit/. Each has a string literal with an unescaped/mismatched quote, which is a parse error, not a test assertion failure — the entire file fails to even load.

Found while running nightly regression tests (deno isn't preinstalled in the sandbox this ran in, so this was verified with deno 2.9.3 installed manually via the official installer).

Broken files

  1. packages/supabase/tests/unit/ccpa-gpc.test.ts:61

    'Enabled value should be '1' per GPC specification'
    

    Unescaped ' around 1 inside a single-quoted string.

  2. packages/supabase/tests/unit/ccpa-notifications.test.ts:422

    userName: 'José O'Brien",
    

    Unescaped apostrophe in "O'Brien", and the string opens with ' but closes with ".

  3. packages/supabase/tests/unit/ccpa-pdf-generator.test.ts:356

    data.personalInformation.lastName = 'O'Brien"
    

    Same pattern as Bump next from 15.4.1 to 15.4.7 #2.

Error output

error: SyntaxError: Expected ',', got 'numeric literal (1, 1)'
   |
61 |       'Enabled value should be '1' per GPC specification'
   |                                 ~
    at .../packages/supabase/tests/unit/ccpa-gpc.test.ts:61:33
```//similar for the other two files.

## Why this wasn't caught

None of the repo's GitHub Actions workflows (`.github/workflows/*.yml`) actually invoke `test:deno`, `packages/supabase/tests`, or `run-tests.sh` — only `functions/api/__tests__/**` (a separate directory) is exercised in CI (`api-tests.yml`). So this suite only runs for local contributors who manually run `pnpm test:deno`, and nobody has noticed.

`git log -S` shows these lines were last touched in #334 (2026-06-09, an unrelated onboarding-UI commit, likely a mass reformat/rebase) but the quote bug traces back further — there's an earlier commit titled "fix: continue resolving TypeScript quote errors" that apparently didn't catch these three.

## Suggested fix

Escape the apostrophes (e.g. `\'1\'` / `"José O'Brien"` with consistent quote style) in the 3 lines above. Small, mechanical fix — no logic changes needed.

## Separately (not filed as an issue, for context)

Even after fixing the syntax, most files in `packages/supabase/tests/unit/` use extension-less relative imports (e.g. `'../shared/assert'`) that Deno 2.x can't resolve without `--unstable-sloppy-imports` or explicit `.ts` extensions, so the suite needs that flag (or extensions added) to actually run. Flagging here in case whoever picks this up wants to fix both at once, but happy to file separately if preferred.

---
Filed automatically by a nightly regression-test run.

Activity

  1. added
    bug
    on Jul 22, 2026
  2. thinkclay commented on Jul 30, 2026

    @thinkclay
    ContributorAuthor

    Fixed in 6c6e5be0a. The three CCPA files parse, and the unit suite now runs: 104 passed, 0 failed, from zero tests executing.

    Note ccpa-gpc.test.ts had two mismatched literals, not one — Deno reports only the first syntax error per file, so the second (line 492) only appeared after fixing line 61. Worth knowing for any similar sweep.

  3. added a commit that references this issue on Jul 30, 2026
    d856e10
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions