feat(FN-2324): merge fusion/fn-2324

This commit is contained in:
gsxdsm
2026-04-24 08:38:17 -07:00
parent b8f4c890dc
commit f69fb4fe76
7 changed files with 540 additions and 556 deletions

View File

@@ -174,10 +174,14 @@ describe("bin", () => {
return import("../bin.ts");
}
it("routes task list with --project before subcommand", async () => {
await runBin(["--project", "my-app", "task", "list"]);
expect(runTaskList).toHaveBeenCalledWith("my-app");
});
it(
"routes task list with --project before subcommand",
async () => {
await runBin(["--project", "my-app", "task", "list"]);
expect(runTaskList).toHaveBeenCalledWith("my-app");
},
15000,
);
it("preserves legacy task list behavior when project flag is absent", async () => {
await runBin(["task", "list"]);

View File

@@ -243,10 +243,14 @@ describe("bin command routing and fallbacks", () => {
expect(logSpy).toHaveBeenCalledWith(expect.stringContaining("Usage:"));
});
it("prints an error for unknown top-level command", async () => {
await expect(runBin(["unknown-cmd"])).rejects.toThrow("process.exit:1");
expect(errorSpy).toHaveBeenCalledWith("Unknown command: unknown-cmd");
});
it(
"prints an error for unknown top-level command",
async () => {
await expect(runBin(["unknown-cmd"])).rejects.toThrow("process.exit:1");
expect(errorSpy).toHaveBeenCalledWith("Unknown command: unknown-cmd");
},
15000,
);
it("errors on duplicate --project flags", async () => {
await expect(runBin(["task", "list", "--project", "alpha", "-P", "beta"])).rejects.toThrow(