diff options
| author | amankumarsingh77 <amankumarsingh7702@gmail.com> | 2026-07-27 01:07:05 +0530 |
|---|---|---|
| committer | Aman Kumar <145339995+amankumarsingh77@users.noreply.github.com> | 2026-08-02 19:12:46 +0530 |
| commit | d1b57558ff40ef6d6b19ee7eff0a44f7f4a585f6 (patch) | |
| tree | 9172819196434737d1ecb63e22a2ad102b97ebd9 /src/client.ts | |
| parent | 9f2ef1cf87251ce12f6b6432c48c6e7d2017b6b5 (diff) | |
test(cdp): cover call/callOnTarget/callBrowser through a stub transport; collapse decode into one path
session-call-test.ts previously only exercised decodeResult (Task 3's
surface, and mostly duplicating commands-test.ts) — call, callOnTarget,
callBrowser, and the session's internal req helper had zero coverage.
Add a stub CdpTransport (no socket, no browser) and test: a valid payload
decodes to typed data, a garbage payload becomes invalid_response without
throwing, a transport-level error passes through with its original kind
(not relabeled), call/callOnTarget/callBrowser route the session id
correctly, and opts.timeoutMs reaches the transport only when provided.
Also collapse the four near-identical transport-then-decode bodies (req,
call, callOnTarget, callBrowser) into one: the three public methods now
delegate to req, which is the sole place unknown ends for every CDP call
the session makes, internal or public. Public signatures are unchanged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'src/client.ts')
0 files changed, 0 insertions, 0 deletions
