fix(portal-clis): reject invalid --format flags with BAD_ARG in linkedin-search and freehire-search (#555) (#556)

This commit is contained in:
Oscar Madera authored and GitHub committed 2026-10-15 11:56:24 +02:00
1 parent a644df0625
commit c922b0c757
5 files changed
+75 -8

No files matched your search

@@ -134,6 +134,24 @@ describe("LinkedIn CLI flag validation", () => {
expect(err.code).not.toBe("BAD_ARG");
});
});
describe("--format validation", () => {
test("search with an unsupported format exits 1 with BAD_ARG", async () => {
const result = await runCLI(["search", "-l", LOCATION, "--format", "invalid"]);
expect(result.exitCode).not.toBe(0);
const err = parsedStderr(result.stderr);
expect(err.code).toBe("BAD_ARG");
expect(err.error).toMatch(/format/);
});
test("detail with an unsupported format exits 1 with BAD_ARG", async () => {
const result = await runCLI(["detail", "123456", "--format", "table"]);
expect(result.exitCode).not.toBe(0);
const err = parsedStderr(result.stderr);
expect(err.code).toBe("BAD_ARG");
expect(err.error).toMatch(/format/);
});
});
});