fix(test): add missing headers to diffs index test mock#39041
fix(test): add missing headers to diffs index test mock#39041ademczuk wants to merge 3 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a test crash in
Confidence Score: 5/5
Last reviewed commit: 2b7d0bd |
3680ba7 to
3b0b91e
Compare
|
@steipete -- this could use a review when you've got a moment. Context: 1-line test mock fix for the The "Repro + Verification" section in the description has the full stack trace and before/after CI evidence. |
|
Duplicate triage result from top-100 open PR review. Keeping #39063 open as canonical for this fix. Why #39063 won:
Closing this PR to consolidate on a single implementation path. |
Summary
extensions/diffs/index.test.tsthrowsTypeError: Cannot read properties of undefined (reading 'x-forwarded-for')in theapplies plugin-config defaultstest case.checks (node, extensions)CI job due to this, even when the PR doesn't touch extensions code. Blocks merge readiness assessment for unrelated PRs.headers: {}to thelocalReq()mock helper sohasProxyForwardingHints()can safely accessreq.headers.index.test.ts. The identicallocalReq()helper inhttp.test.tsalready has this property (added in 44881b0).Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
hasProxyForwardingHints()and updatedhttp.test.tsbut missedindex.test.tsUser-visible / Behaviour Changes
None. Test-only change.
Security Impact (required)
Repro + Verification
Environment
Steps
checks (node, extensions, pnpm test:extensions)CI jobextensions/diffs/index.test.tsExpected
All 258 extension test files pass (2260 tests).
Actual
1 test file fails, 257 pass. The specific failure:
Evidence
Before (from CI run on another open PR):
After (CI on this branch):
Human Verification (required)
localReq()helper inhttp.test.ts:235-244already includesheaders: input.headers ?? {}as the established pattern from the same commit (44881b0)index.test.ts'slocalReq()is the only other mock helper that was missedindex.test.tsfile:localReq()is called once (line 125), always with{ method, url }, never needs custom headersCompatibility / Migration
Failure Recovery (if this breaks)
Risks and Mitigations
None. Single-line addition to a test helper with no production code impact.