mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 23:00:03 +00:00
fix(render): allow explicit entry without index (#2307)
* fix(render): allow explicit entry without index * fix(render): unify explicit composition handling * test(cli): allow explicit render integration under CI load
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
// fallow-ignore-file code-duplication
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
|
||||
const producerState = vi.hoisted(() => ({
|
||||
createdJobs: [] as Array<Record<string, unknown>>,
|
||||
@@ -1065,4 +1068,40 @@ describe("render fps arg definition", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("render command explicit composition", () => {
|
||||
it("renders an explicit composition from a project with no index.html", async () => {
|
||||
const projectDir = mkdtempSync(join(tmpdir(), "hf-render-explicit-"));
|
||||
const outputPath = join(projectDir, "out.mp4");
|
||||
writeFileSync(
|
||||
join(projectDir, "standalone.html"),
|
||||
`<html><body>
|
||||
<div data-composition-id="standalone" data-width="1920" data-height="1080" data-duration="1"></div>
|
||||
<script>window.__timelines = { standalone: gsap.timeline({ paused: true }) };</script>
|
||||
</body></html>`,
|
||||
);
|
||||
vi.useFakeTimers();
|
||||
|
||||
try {
|
||||
const command = (await import("./render.js")).default;
|
||||
await command.run?.({
|
||||
args: {
|
||||
dir: projectDir,
|
||||
composition: "standalone.html",
|
||||
output: outputPath,
|
||||
quiet: true,
|
||||
quality: "standard",
|
||||
format: "mp4",
|
||||
},
|
||||
} as never);
|
||||
|
||||
expect(producerState.createdJobs.at(-1)).toMatchObject({
|
||||
entryFile: "standalone.html",
|
||||
});
|
||||
} finally {
|
||||
vi.clearAllTimers();
|
||||
rmSync(projectDir, { recursive: true, force: true });
|
||||
}
|
||||
}, 60_000);
|
||||
});
|
||||
|
||||
// Variables-helper tests live in `../utils/variables.test.ts`.
|
||||
|
||||
Reference in New Issue
Block a user