mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-04 21:17:30 +00:00
test(cli): check waits as long as snapshot for the composition by default
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user