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:
Miguel Ángel
2026-07-12 23:01:27 -04:00
committed by GitHub
parent 7c0dcb0b14
commit 796d5df156
6 changed files with 97 additions and 12 deletions
+39
View File
@@ -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`.