mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-01 19:42:03 +00:00
fix(cli): complete process lifecycle migration
This commit is contained in:
@@ -45,7 +45,7 @@ describe("cloud/errors reportApiError", () => {
|
||||
message: "project too large",
|
||||
code: "hyperframes_project_too_large",
|
||||
});
|
||||
expect(() => reportApiError("Upload failed", err)).toThrow("process.exit called");
|
||||
expect(() => reportApiError("Upload failed", err)).toThrow(CliRuntimeError);
|
||||
expect(errorBox).toHaveBeenCalledWith(
|
||||
"Upload failed (HTTP 413)",
|
||||
"project too large",
|
||||
|
||||
@@ -49,15 +49,13 @@ describe("validateResolutionFormatCombo", () => {
|
||||
|
||||
describe("validateDryRunSource", () => {
|
||||
it("accepts a local directory and rejects already-uploaded sources", () => {
|
||||
const exit = trapExit();
|
||||
expect(() => validateDryRunSource({ kind: "dir", dir: "." }, true)).not.toThrow();
|
||||
expect(() => validateDryRunSource({ kind: "asset_id", assetId: "asst_123" }, true)).toThrow(
|
||||
"process.exit:1",
|
||||
CliRuntimeError,
|
||||
);
|
||||
expect(() =>
|
||||
validateDryRunSource({ kind: "url", url: "https://example.com/project.zip" }, true),
|
||||
).toThrow("process.exit:1");
|
||||
expect(exit).toHaveBeenCalledTimes(2);
|
||||
).toThrow(CliRuntimeError);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -370,7 +370,7 @@ export function validateDryRunSource(source: ProjectInputSource, dryRun: boolean
|
||||
"Invalid --dry-run input",
|
||||
"--dry-run inspects a local project directory and cannot be combined with --asset-id or --url.",
|
||||
);
|
||||
process.exit(1);
|
||||
failCommand();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -616,7 +616,7 @@ function prepareLocalArchive(
|
||||
} catch (err) {
|
||||
const msg = normalizeErrorMessage(err);
|
||||
errorBox("Zip failed", msg, "Check the project and .hyperframesignore for missing files.");
|
||||
process.exit(1);
|
||||
failCommand();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2152,7 +2152,7 @@ function handleRenderError(
|
||||
const macosRemediation = macosOldChromeCrashRemediation(message);
|
||||
if (macosRemediation) {
|
||||
errorBox("Render failed — Chrome could not launch", message, macosRemediation);
|
||||
process.exit(1);
|
||||
failCommand();
|
||||
}
|
||||
errorBox("Render failed", message, hint);
|
||||
failCommand();
|
||||
|
||||
Reference in New Issue
Block a user