test(firecrawl): add unit tests for firecrawl client functions#97714
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 4:59 AM ET / 08:59 UTC. Summary PR surface: Tests +735. Total +735 across 2 files. Reproducibility: not applicable. This PR adds regression coverage rather than reporting a runtime bug. The reviewed path is source-verifiable through the existing Firecrawl helper exports and adjacent tool tests. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land or lightly refine the dedicated client tests while keeping the Firecrawl runtime behavior unchanged. Do we have a high-confidence way to reproduce the issue? Not applicable; this PR adds regression coverage rather than reporting a runtime bug. The reviewed path is source-verifiable through the existing Firecrawl helper exports and adjacent tool tests. Is this the best way to solve the issue? Yes; a colocated unit-test file for the existing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ff1e7e1305cc. Label changesLabel justifications:
Evidence reviewedPR surface: Tests +735. Total +735 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
3e44220 to
f4af21b
Compare
|
Fixed the TS2345 type error on Type check: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
f4af21b to
0f3bdb7
Compare
|
Fixed the
All 44 tooling tests + 52 firecrawl tests pass locally. ✅ @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Updated PR body with Direct behavior probe matching the pattern from recently merged test-only PRs (e.g. #96736, #96448). @clawsweeper re-review |
What Problem This Solves
The
firecrawl-client.tsmodule provides URL safety validation, search-item extraction, and scrape payload parsing for the Firecrawl web tools plugin. However, this module lacked unit tests to verify the client behavior, which could lead to regressions when the functions are modified.Why This Change Was Made
Add unit tests for
assertFirecrawlScrapeTargetAllowed,resolveSearchItems, andparseFirecrawlScrapePayloadto verify client behavior including URL validation, multi-shape search response extraction, scrape payload parsing, and truncation boundaries. This improves test coverage and prevents regressions.The module already exported these functions through its
testingobject, confirming they were intended for direct unit coverage.Focused tests cover:
User Impact
No user-visible change. The Firecrawl client helpers now have comprehensive unit coverage, reducing the risk of regressions when the functions are modified.
Evidence
Reproducibility: not applicable. This PR adds direct coverage for existing helper behavior rather than reporting a user-visible runtime bug. Source inspection confirms the helper behavior the tests target.
Direct behavior probe:
Unit test run: