From 75b043ee42814acda921ad47f3925ee79a4e0e8c Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 6 Mar 2026 23:02:32 +0000 Subject: [PATCH 1/6] test: reproduce issue with alias and --- test/parser.test.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/parser.test.ts b/test/parser.test.ts index b1794c0..7289306 100644 --- a/test/parser.test.ts +++ b/test/parser.test.ts @@ -15,6 +15,32 @@ describe("parseRawArgs", () => { }); }); + it('handles --=', ()=>{ + const result = parseRawArgs(["--name=John"], { + string: ["name"] + }); + + expect(result).toEqual({ + _: [], + name: "John" + }) + }) + + it('handles -= with alias', ()=>{ + const result = parseRawArgs(["-n=John"], { + string: ["name"], + alias: { + n: ["name"] + } + }) + + expect(result).toEqual({ + _: [], + n: "John", + name: "John", + }) + }) + it("handles default values", () => { const result = parseRawArgs([], { default: { name: "Default" } }); @@ -34,6 +60,8 @@ describe("parseRawArgs", () => { }); }); + + it("handles boolean flags", () => { const result = parseRawArgs(["--flag"], { boolean: ["flag"] }); From a69b705f2be9922e11dc2b368d3d59dd092207ab Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 7 Mar 2026 11:58:20 +0100 Subject: [PATCH 2/6] chore: remove empty lines --- test/parser.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/parser.test.ts b/test/parser.test.ts index 7289306..e3aa314 100644 --- a/test/parser.test.ts +++ b/test/parser.test.ts @@ -60,8 +60,6 @@ describe("parseRawArgs", () => { }); }); - - it("handles boolean flags", () => { const result = parseRawArgs(["--flag"], { boolean: ["flag"] }); From c5d1168ec3c9b98e931e9288df60faea28d9d4fb Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sun, 15 Mar 2026 19:56:22 +0000 Subject: [PATCH 3/6] chore: apply automated updates --- test/parser.test.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/parser.test.ts b/test/parser.test.ts index e3aa314..3b1789a 100644 --- a/test/parser.test.ts +++ b/test/parser.test.ts @@ -15,31 +15,31 @@ describe("parseRawArgs", () => { }); }); - it('handles --=', ()=>{ + it("handles --=", () => { const result = parseRawArgs(["--name=John"], { - string: ["name"] + string: ["name"], }); expect(result).toEqual({ _: [], - name: "John" - }) - }) + name: "John", + }); + }); - it('handles -= with alias', ()=>{ + it("handles -= with alias", () => { const result = parseRawArgs(["-n=John"], { string: ["name"], alias: { - n: ["name"] - } - }) + n: ["name"], + }, + }); expect(result).toEqual({ _: [], n: "John", name: "John", - }) - }) + }); + }); it("handles default values", () => { const result = parseRawArgs([], { default: { name: "Default" } }); From c3192f70ba5ba6a867b13fcb8031dd91941ae566 Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 15 Mar 2026 21:05:23 +0100 Subject: [PATCH 4/6] chore: update test to intended behavior --- test/parser.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parser.test.ts b/test/parser.test.ts index 3b1789a..413e5ab 100644 --- a/test/parser.test.ts +++ b/test/parser.test.ts @@ -36,8 +36,8 @@ describe("parseRawArgs", () => { expect(result).toEqual({ _: [], - n: "John", - name: "John", + n: "=John", + name: "=John", }); }); From 59b7f3f70f97244fdc61259a4df73812e1c6809e Mon Sep 17 00:00:00 2001 From: Robin Date: Sun, 15 Mar 2026 21:30:50 +0100 Subject: [PATCH 5/6] chore: mark test as failing Co-authored-by: Robin --- test/parser.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parser.test.ts b/test/parser.test.ts index 413e5ab..11e566f 100644 --- a/test/parser.test.ts +++ b/test/parser.test.ts @@ -26,7 +26,7 @@ describe("parseRawArgs", () => { }); }); - it("handles -= with alias", () => { + it.fails("handles -= with alias", () => { const result = parseRawArgs(["-n=John"], { string: ["name"], alias: { @@ -36,8 +36,8 @@ describe("parseRawArgs", () => { expect(result).toEqual({ _: [], - n: "=John", - name: "=John", + n: "John", + name: "John", }); }); From c095d81b4b0f11815eb3a8ce82ba979d16e3a8e7 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 15 Mar 2026 21:45:07 +0100 Subject: [PATCH 6/6] Apply suggestion from @pi0 --- test/parser.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parser.test.ts b/test/parser.test.ts index 11e566f..7180fee 100644 --- a/test/parser.test.ts +++ b/test/parser.test.ts @@ -26,7 +26,7 @@ describe("parseRawArgs", () => { }); }); - it.fails("handles -= with alias", () => { + it.fails("handles -= with alias (#237)", () => { const result = parseRawArgs(["-n=John"], { string: ["name"], alias: {