From 2850f3b18e4ef99b8343746e103ad4ecdea9fee2 Mon Sep 17 00:00:00 2001 From: MAVRICK-1 Date: Fri, 20 Dec 2024 03:28:31 +0530 Subject: [PATCH] Fix typo in syntax validation for positional arguments and add regression test Signed-off-by: MAVRICK-1 --- packages/imperative/CHANGELOG.md | 5 +++++ .../cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 0ba57c37bf..14224c3985 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to the Imperative package will be documented in this file. +## `8.10.2` + +- bugfix: fixed a typo in the syntax validation code for positional arguments. the bug caused the validation to never fail. [#2384](https://github.com/zowe/zowe-cli/pull/2384) +- enhancement: added a regression test to validate the fix. [#2384](https://github.com/zowe/zowe-cli/pull/2384) + (note: non-user-facing items like regression tests are typically not included in the changelog). ## `8.10.1` diff --git a/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts b/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts index 92f8c74379..76759b6b51 100644 --- a/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts +++ b/packages/imperative/src/cmd/src/syntax/__tests__/SyntaxValidator.unit.test.ts @@ -525,7 +525,7 @@ describe("Imperative should provide advanced syntax validation rules", () => { expect(svResponse.valid).toEqual(true); }); - it.only("If a positional argument does not match the defined regex, the command should fail", async () => { + it("should fail if a positional argument does not match the defined regex", async () => { const invalidPositional = "invalid_value"; const regexForPositional = "^[a-zA-Z0-9_]+$";