From 31ad2d9d706eacdd85e58d286fe4e9dfe2c23016 Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Thu, 15 Jan 2026 00:40:16 +0000 Subject: [PATCH] Fix regex to match dependency paths with special characters Update the regex in the regression test to use [^\n]+ instead of [@\w./-]+ to match dependency paths that contain parentheses, angle brackets, and spaces (e.g., "(root) > peer-deps-fixed"). Co-Authored-By: Claude Opus 4.5 --- test/regression/issue/26076.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/regression/issue/26076.test.ts b/test/regression/issue/26076.test.ts index 6722f8a960..12a4ca7b1e 100644 --- a/test/regression/issue/26076.test.ts +++ b/test/regression/issue/26076.test.ts @@ -72,9 +72,10 @@ describe("issue #26076 - peer dependency warnings", () => { expect(stderr).toContain("no-deps@^1.0.0"); expect(stderr).toContain("(found 2.0.0)"); - // Verify the full format with regex - supports scoped packages and hyphenated names - // Pattern matches: "warn: ... has unmet peer dependency @ (found )" - expect(stderr).toMatch(/(?:warn:\s*)?[@\w./-]+ has unmet peer dependency [@\w./-]+@\S+ \(found \S+\)/); + // Verify the full format with regex - supports dependency paths like "(root) > peer-deps-fixed" + // Pattern matches: "warn: ... has unmet peer dependency @ (found )" + // Use [^\n]* to match any characters in the dependency path (including parentheses, >, spaces) + expect(stderr).toMatch(/(?:warn:\s*)?[^\n]+ has unmet peer dependency [@\w./-]+@\S+ \(found \S+\)/); expect(exitCode).toBe(0); });