diff options
Diffstat (limited to 'packages/cli/src/args.test.ts')
| -rw-r--r-- | packages/cli/src/args.test.ts | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/packages/cli/src/args.test.ts b/packages/cli/src/args.test.ts index 62bcafd..992d09f 100644 --- a/packages/cli/src/args.test.ts +++ b/packages/cli/src/args.test.ts @@ -190,6 +190,7 @@ describe("parseArgs", () => { expect(parseArgs(["list"], { defaultServer })).toEqual({ kind: "list", server: "http://localhost:24203", + all: false, }); }); @@ -198,6 +199,7 @@ describe("parseArgs", () => { kind: "list", server: "http://localhost:24203", query: "abc12345", + all: false, }); }); @@ -206,9 +208,36 @@ describe("parseArgs", () => { kind: "list", server: "http://s", query: "abc", + all: false, }); }); + it("parses 'list' with --status", () => { + expect(parseArgs(["list", "--status", "closed"], { defaultServer })).toEqual({ + kind: "list", + server: "http://localhost:24203", + status: "closed", + all: false, + }); + }); + + it("parses 'list' with --all", () => { + expect(parseArgs(["list", "--all"], { defaultServer })).toEqual({ + kind: "list", + server: "http://localhost:24203", + all: true, + }); + }); + + it("parses 'list' with --status and --all ( --all takes precedence)", () => { + const result = parseArgs(["list", "--status", "active", "--all"], { defaultServer }); + expect(result.kind).toBe("list"); + if (result.kind === "list") { + expect(result.all).toBe(true); + expect(result.status).toBe("active"); + } + }); + it("errors on a second positional argument", () => { const result = parseArgs(["list", "abc", "def"], { defaultServer }); expect(result.kind).toBe("error"); |
