From 238f8cd4d83182cef38cdffc90938455d2f78c3c Mon Sep 17 00:00:00 2001 From: x Date: Sun, 1 Nov 2026 13:02:25 -0500 Subject: [PATCH] test(cli): check waits as long as snapshot for the composition by default --- packages/cli/src/commands/check.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/cli/src/commands/check.test.ts b/packages/cli/src/commands/check.test.ts index 2a22a6af94..91d5df75b5 100644 --- a/packages/cli/src/commands/check.test.ts +++ b/packages/cli/src/commands/check.test.ts @@ -3,6 +3,7 @@ import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "nod import { tmpdir } from "node:os"; import { join } from "node:path"; import { afterEach, describe, expect, it, vi } from "vitest"; +import { DEFAULT_CONFIG } from "@hyperframes/engine"; const trackCheckReport = vi.fn(); vi.mock("../telemetry/events.js", () => ({ @@ -497,6 +498,24 @@ describe("skip contrast in motion", () => { }); }); +it("waits for the composition as long as snapshot and render do unless --timeout says otherwise", async () => { + const { report } = await runScenario(fakeDriver()); + const runPipeline = vi.fn(async (_project: ProjectDir, _options: CheckOptions) => report); + vi.spyOn(console, "log").mockImplementation(() => undefined); + const command = createCheckCommand({ + resolveProject: () => PROJECT, + runPipeline, + prepareMedia: vi.fn(async () => []), + withMeta: (value) => value, + }); + + await runCommand(command, { rawArgs: ["--json"] }); + await runCommand(command, { rawArgs: ["--json", "--timeout", "20s"] }); + + expect(runPipeline.mock.calls[0]?.[1].timeout).toBe(DEFAULT_CONFIG.playerReadyTimeout); + expect(runPipeline.mock.calls[1]?.[1].timeout).toBe(20_000); +}); + it("parses the caption-zone grammar and enables the frame gate", async () => { const { report } = await runScenario(fakeDriver()); const runPipeline = vi.fn(async (_project: ProjectDir, _options: CheckOptions) => report);