Skip to content

test: drop duplicate tests and repeated setup - #12

Merged
proxynico merged 1 commit into
mainfrom
refactor/simplify-tests
Nov 14, 2026
Merged

proxynico merged 1 commit into
mainfrom
refactor/simplify-tests

Conversation

@proxynico

Copy link
Copy Markdown
Owner

Part of the cleanup Nico asked for: the tests repeated each other and spelled out the same setup by hand. This removes about 100 lines of tests and keeps every behaviour they checked.

What changes

  • The identity tests were split between entities.test.ts and api-parsing.test.ts, which tested the same thing twice. They now live in entities.test.ts, and the parseEntityRef case already in validation.test.ts is gone. The stale "we can't import the private parse functions" comment goes with them.
  • One song() fixture replaces six hand-written song objects in the pagination tests.
  • One capture() helper in tests/capture.ts replaces four copies of the console swap-and-restore code.
  • The "defaults to the latest year" Replay test uses the shared Replay engine, and the auto engine tests reuse the stub engine's empty search.
  • AGENTS.md gives the new test count.

Blast Radius

Tests only. No source file changes. Revert the commit to undo.

Verification

  • bun run check passes: 87 tests across 16 files. The two tests removed exactly repeated others.
  • I broke source code on purpose to confirm the rewritten tests still catch it. A wrong page size failed both pagination tests. A different bar width and an extra character in the error hint failed the Replay output test and both error-output tests.

Created with Claude Opus 5.5 in Claude Code.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T03:32:00.159364Z 882cba3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

The identity tests live in one file instead of two, without the cases
that repeated each other or the parsing tests in validation.test.ts.

One `song()` fixture, one console `capture()` helper and the shared
Replay engine replace setup that each test spelled out by hand. The auto
engine tests reuse the stub engine's empty search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@proxynico
proxynico force-pushed the refactor/simplify-tests branch from 882cba3 to 90ce988 Compare November 14, 2026 03:35
@proxynico

Copy link
Copy Markdown
Owner Author

Note

🤖 Claude Opus 5.5 responding on behalf of proxynico

Independent check: PASS on head 90ce988 against base 704c226. The checker was GPT-6.1 Sol (Codex, xhigh effort), which wrote none of this change.

The first check, on 882cba3, failed. Merging the identity tests had dropped three assertions: source in the library and derived cases, and catalogId in the catalog-only case. A change to buildIdentity that swapped source and dropped catalogId left all 87 tests passing. 90ce988 restores the three assertions and changes nothing else.

The re-check confirmed:

  • The diff between 882cba3 and 90ce988 is exactly those three lines.
  • The same sabotage now fails 3 tests.
  • Every assertion in the base identity tests maps to one on head. The parsed-reference case is covered in validation.test.ts.
  • bun run check passes with 87 tests across 16 files, matching AGENTS.md.
  • In the first check, five other deliberate breaks (pagination limit, plain-output escaping, status progress width, Replay bar width, error hint) were each caught.

@proxynico
proxynico merged commit f8cb512 into main Nov 14, 2026
1 check passed
@proxynico
proxynico deleted the refactor/simplify-tests branch November 14, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant