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

Function stagedFetch

packages/cli/src/utils/publishProject.test.ts:458–488  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

456 it("sends is_public in the staged complete body only when public is requested", async () => {
457 const dir = makeProjectDir();
458 const stagedFetch = () =>
459 vi
460 .fn()
461 .mockResolvedValueOnce(
462 new Response(
463 JSON.stringify({
464 data: {
465 upload_url: "https://s3.example.com/upload",
466 upload_key: "ephemeral_store/hyperframes/project_uploads/upload-1/demo.zip",
467 upload_headers: { "content-type": "application/zip" },
468 content_type: "application/zip",
469 },
470 }),
471 { status: 200 },
472 ),
473 )
474 .mockResolvedValueOnce(new Response(null, { status: 200 }))
475 .mockResolvedValueOnce(
476 new Response(
477 JSON.stringify({
478 data: {
479 project_id: "hfp_123",
480 title: "demo",
481 file_count: 1,
482 url: "https://hyperframes.dev/p/hfp_123",
483 claim_token: "claim-token",
484 },
485 }),
486 { status: 200 },
487 ),
488 );
489
490 try {
491 writeFileSync(join(dir, "index.html"), "<html></html>", "utf-8");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected