MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / headersOf

Function headersOf

packages/cli/src/cloud/index.test.ts:29–35  ·  view source on GitHub ↗
(call: readonly unknown[] | undefined)

Source from the content-addressed store, hash-verified

27// Narrow a recorded fetch call to the headers of its RequestInit without
28// casting; throws (failing the test) if the call shape is unexpected.
29const headersOf = (call: readonly unknown[] | undefined): unknown => {
30 const init = call?.[1];
31 if (init === null || init === undefined || typeof init !== "object" || !("headers" in init)) {
32 throw new Error("expected fetch to be called with a RequestInit carrying headers");
33 }
34 return init.headers;
35};
36
37describe("createCloudClient 401-retry decorator", () => {
38 // The generated client falls back to global fetch when no fetchImpl is

Callers 1

index.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected