Skip to content

bug: tests/unit/roles.test.ts has 3 fully duplicated tests on main #2057

Closed

Description

@carlos-alm

Found while resolving merge conflicts on PR #1955.

git show origin/main:tests/unit/roles.test.ts currently contains three it(...) blocks that each appear TWICE, back-to-back, with byte-identical bodies:

  • excludes parameter-kind nodes from role classification entirely
  • does not classify interface members as dead
  • regression: used parameters, interface members, and a genuinely dead function are classified correctly together

Verified via diff on the two occurrence ranges in a clean git show origin/main:... dump — zero differences, confirming this is a real duplication already committed to main, not a display artifact.

Confirmed this is NOT present on PR #1955's own branch tip (each test appears exactly once there), so it was introduced by some other merge/resolution that landed on main independently, likely during an earlier /resolve in this same stacked-PR chain where tests/unit/roles.test.ts was a non-owned "take main's side" file and a merge produced a duplicated block that then propagated forward through subsequent merges.

Not a functional bug (duplicate it() names are legal in vitest and both copies pass), but it's dead weight and a sign a merge went subtly wrong somewhere in this chain's history. Worth a follow-up commit to git log -p the relevant history and remove the duplicate copies of these three tests.

Activity

  1. added
    follow-upDeferred work from PR reviews that needs tracking
    on Jul 8, 2026
  2. carlos-alm commented on Aug 5, 2026

    @carlos-alm
    ContributorAuthor

    Re-verified via git show origin/main:tests/unit/roles.test.ts (the same reproduction method this issue used) — the duplication is no longer present on main.

    • excludes parameter-kind nodes from role classification entirely — appears once
    • does not classify interface members as dead — appears once
    • The third test's name has since evolved to regression: used parameters, unused properties, interface members, and a genuinely dead function are classified correctly together (picked up the "unused properties" case along the way, per fix(roles): exclude genuine class/struct properties from dead-role classification #1956) — appears once

    Some later commit in this file's history (most likely #1956's fix(roles): exclude genuine class/struct properties from dead-role classification, which touched this same regression test) superseded the duplicated block rather than merely deduplicating it verbatim, so there's no separate dedup commit to point to — the file is simply correct on main today. No code change needed. Closing as already resolved.

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

    follow-upDeferred work from PR reviews that needs tracking

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions