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

Function makeMinimalPlanTar

packages/aws-lambda/src/handler.test.ts:554–570  ·  view source on GitHub ↗

* Build a minimal `.tar.gz` for a tiny planDir containing `plan.json` + * `meta/chunks.json`. Used by renderChunk/assemble tests where the handler * untars but the mock primitive doesn't inspect contents.

()

Source from the content-addressed store, hash-verified

552 * untars but the mock primitive doesn't inspect contents.
553 */
554async function makeMinimalPlanTar(): Promise<Buffer> {
555 const tar = await import("tar");
556 const {
557 mkdtempSync: mk,
558 mkdirSync: md,
559 readFileSync: rf,
560 writeFileSync: wf,
561 } = await import("node:fs");
562 const dir = mk(join(tmpdir(), "hf-lambda-test-plan-"));
563 tmpDirs.push(dir);
564 md(join(dir, "meta"), { recursive: true });
565 wf(join(dir, "plan.json"), JSON.stringify({ planHash: "fakehash" }));
566 wf(join(dir, "meta", "chunks.json"), "[]");
567 const tarPath = join(dir, "out.tar.gz");
568 await tar.create({ gzip: true, file: tarPath, cwd: dir }, ["plan.json", "meta"]);
569 return rf(tarPath);
570}

Callers 1

handler.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected