mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-11-02 21:22:51 +00:00
fix(portal-clis): reject invalid --format flags with BAD_ARG in linkedin-search and freehire-search (#555) (#556)
This commit is contained in:
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/);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user