Skip to content

test(deployments): table-drive normalizeUrl and share task fixture helper - #212

Merged
jackchuma merged 1 commit into
mainfrom
toshi/cleanup-deployments-test-helpers-34dc5ae2
Oct 26, 2026
Merged

jackchuma merged 1 commit into
mainfrom
toshi/cleanup-deployments-test-helpers-34dc5ae2

Conversation

@jackchuma

@jackchuma jackchuma commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Test-only cleanup of src/lib/__tests__/deployments.test.ts. deployments.ts is unchanged.

  • normalizeUrl: the 17 single-assertion tests become two it.each tables, one for accepted inputs (input → expected output) and one for rejected inputs (→ undefined). Every input string and expected value is kept, including all three trailing-punctuation cases.
  • getUpgradeOptions: a local makeTask(id, network, readme?) helper creates <tempDir>/active/evm/tasks/<id>/config/<network>/validations, writes the README when given, and enters the tool directory. The five active-task tests use it. The legacy root-level layout test keeps its own setup so it still builds a legacy layout and no active task.
  • Every README string, task id, getUpgradeOptions call, and assertion is unchanged, including pending status, the serialized executionLinks check, descending task order, and the non-date-prefix filter.

Interfaces removed

None. Only the test file changes.

Validation

  • npm test: 14 suites, 172 tests pass. normalizeUrl now reports 19 cases because the old three-assertion punctuation test became three table rows; no case was added or dropped.
  • npm run lint, npx tsc --noEmit, npm run build, npx prettier --check src/lib/__tests__/deployments.test.ts pass.

No new tests: this change only restructures existing ones.

Why this cleanup

  • Production: +0 / -0 (net 0). Tests: +45 / -151 (net -106), one file.
  • Interfaces removed: none.
  • A reader no longer has to parse six hand-built copies of the tool-dir/task-dir/README/chdir fixture, three nested 4-deep path.join blocks, or 17 near-identical normalizeUrl test bodies. Each discovery test is now one to three setup lines plus its unchanged assertions.
  • Keep gate judge: test-only change with every input and assertion preserved; it removes repeated fixture setup and duplicate same-path URL tests, matching the scan's rules, and is easy to verify side by side.

…lper

Co-authored-by: Toshi <toshi-noreply@coinbase.com>
J-Engine-Session: toshi:b5ec6472-b003-4cd2-9285-e8921a340f34
@cb-heimdall

cb-heimdall commented Oct 26, 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
Sum 1

@jackchuma
jackchuma marked this pull request as ready for review October 26, 2026 16:17
@jackchuma
jackchuma requested a review from 0xth4nh October 26, 2026 16:18

@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 364d7b6 into main Oct 26, 2026
6 checks passed
@jackchuma
jackchuma deleted the toshi/cleanup-deployments-test-helpers-34dc5ae2 branch October 26, 2026 17:50
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.

4 participants