fix(cli): reject missing init example values (#2376)

This commit is contained in:
Miguel Ángel
2026-07-13 20:42:11 -04:00
committed by GitHub
parent 403ecb56d9
commit 3a020bf543
2 changed files with 17 additions and 0 deletions
+13
View File
@@ -43,6 +43,19 @@ function expectScaffoldedScripts(target: string): void {
}
describe("hyperframes init flag rename", () => {
it("rejects a following flag when --example has no value", () => {
const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
const target = join(dir, "proj");
try {
const res = runInit([target, "--example", "--non-interactive"]);
expect(res.status).toBe(1);
expect(res.stderr).toContain("--example requires a value");
expect(existsSync(target)).toBe(false);
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
it("--example blank scaffolds a bundled project with npm scripts", () => {
const dir = mkdtempSync(join(tmpdir(), "hf-init-test-"));
const target = join(dir, "proj");