Commit 1043d0b
committed
fix(rest): build a real IHttpRequest in the #7541 pin instead of a partial literal
The new test drove both handlers with `{ params, query }` object literals, which
do not satisfy `IHttpRequest` — 2 x TS2345, taking @objectstack/rest's TEST_DEBT
from its recorded 155 to 157. That ledger is a ratchet: it may only shrink.
Fixed at the source rather than by raising the entry, and the fix is not
bookkeeping. `enforceAuth` runs BEFORE either predicate under test and reads
`req.method` and `req.path` — both `undefined` in the old literals — so the pin
was measuring statuses a real caller would not necessarily get. The helper now
returns a complete `IHttpRequest` typed against the contract, so the gate reads
zero errors from this file AND the measured 200/404/501 are the statuses the
real request shape produces.
Not cast to `any`: the neighbouring conformance test casts its handler that way,
but a cast here would have hidden exactly the missing members that make the
measurement faithful.
Measured with the gate's own command (packages/rest/tsconfig.json with the test
globs dropped from `exclude`): 157 before, 155 after — equal to the recorded
ledger entry, which is left untouched.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GHTC2SvMXprxV9eEHqfbCP1 parent 328149f commit 1043d0b
1 file changed
Lines changed: 14 additions & 2 deletions
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
29 | 41 | | |
30 | 42 | | |
31 | 43 | | |
| |||
109 | 121 | | |
110 | 122 | | |
111 | 123 | | |
112 | | - | |
| 124 | + | |
113 | 125 | | |
114 | 126 | | |
115 | 127 | | |
| |||
124 | 136 | | |
125 | 137 | | |
126 | 138 | | |
127 | | - | |
| 139 | + | |
128 | 140 | | |
129 | 141 | | |
130 | 142 | | |
| |||
0 commit comments