Skip to content

test(task-catalog): drop listTasks tests that repeat other tests - #237

Merged
jackchuma merged 2 commits into
mainfrom
chore/drop-duplicate-task-catalog-tests
Nov 7, 2026
Merged

jackchuma merged 2 commits into
mainfrom
chore/drop-duplicate-task-catalog-tests

Conversation

@jackchuma

@jackchuma jackchuma commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

What changed? Why?

Removes three listTasks tests in src/lib/__tests__/task-catalog.test.ts that pin the same README parsing other tests already pin, and tightens the precedence test's last step. Test-only; production code is untouched.

 describe('listTasks')
   omits a Task with a regular-file network config…   (pins READY TO SIGN, id, date)
   uses network, Task, then EVM README precedence      (pins title, ## Description, READY TO SIGN, EXECUTED, no status)
-    expect(listTasks()).toEqual([{ …, status: undefined }])
+    expect(JSON.parse(JSON.stringify(listTasks()))).toEqual([{ … }])   // status key absent after serialization
-  discovers active task folders without root-level network folders   → covered by precedence + regular-file config tests
   returns pending status…                              (kept: only Pending assertion)
-  returns executed status…                             → covered by precedence step 2
-  omits status when the README has no status line      → covered by precedence step 3 + default-description test
   uses the default description…
   returns all active task folders…                     (also covers no root-level network folder layout)

The JSON round-trip keeps the old omits status test's guarantee that serialized output has no status key. It replaces status: undefined, which toEqual treats as absent. A direct not.toHaveProperty('status') would be wrong: production explicitly returns status: undefined (src/lib/task-catalog.ts), which JSON drops.

The precedence test's network README now has a blank line after ## Description. The removed discovery test was the only one with that shape, which is what exercises cleanMarkdownBlock's leading-newline trim.

Interfaces removed: none.

Notes to reviewers

How has it been tested?

  • Mutation check: changing production to return status: null for the no-status case makes the widened precedence assertion fail (unexpected "status": null); reverted.
  • Mutation check: dropping the leading ^\n+ trim in cleanMarkdownBlock makes the precedence test fail (received "\nNetwork description."); reverted.
  • npm test -- src/lib/__tests__/task-catalog.test.ts: 44 passed. npx eslint, npx prettier --check on the file and npx tsc --noEmit: clean.

Why this cleanup

  • Production: +0 / −0. Tests: +3 / −56 (net −53), 1 file. Interfaces removed: none.
  • A reader no longer has to compare three extra README fixtures and assertions to tell whether they cover distinct behavior. Each parsing outcome (title, ## Description with leading/trailing trim, READY TO SIGN, EXECUTED, PENDING, absent status, default description) is pinned once.
  • Keep gate judge: remaining code is unchanged; remaining assertions cover every removed outcome, including serialized missing status and leading-newline trimming; the removed tests came from existing listing coverage in 65a8812 and nothing planned depends on them.

Co-authored-by: Toshi <toshi-noreply@coinbase.com>
J-Engine-Session: je:e00141da-8385-4cd2-899f-04a870173b17
@cb-heimdall

cb-heimdall commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews ✅ 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
1 if authored by an app that is not allowlisted and lacks verified human attribution 0
Sum 1

Co-authored-by: Toshi <toshi-noreply@coinbase.com>
J-Engine-Session: je:e00141da-8385-4cd2-899f-04a870173b17
@jackchuma

Copy link
Copy Markdown
Collaborator Author

Review round 1

Reviewers: cbhq-openai/gpt-6.1-sol (review: no findings); spec check: anthropic/claude-opus-5-5

  • Fixed: [P1] Leading-newline trim of ## Description blocks lost its only test — src/lib/tests/task-catalog.test.ts:277 (5b303e0)
    Synced with main: ad52762 (already current)
    Validation: npm test -- src/lib/__tests__/task-catalog.test.ts 44 passed; eslint, prettier --check, tsc --noEmit clean

🤖 Reply generated with Toshi

@jackchuma
jackchuma marked this pull request as ready for review November 7, 2026 04:31
@jackchuma
jackchuma requested a review from 0xth4nh November 7, 2026 04:31

@0xth4nh 0xth4nh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to Thanh's Toshi

@jackchuma
jackchuma merged commit bff4d20 into main Nov 7, 2026
6 checks passed
@jackchuma
jackchuma deleted the chore/drop-duplicate-task-catalog-tests branch November 7, 2026 17:56
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.

3 participants