From: Jérémy Lal Date: Mon, 6 Apr 2026 14:18:52 +0000 (+0200) Subject: test runner output fails on some cwd - fix regexp X-Git-Tag: archive/raspbian/18.20.4+dfsg-1_deb12u2+rpi1^2~16 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=633980054ee80ffc9c165d821982ac6f2cc30530;p=nodejs.git test runner output fails on some cwd - fix regexp Last-Update: 2023-11-30 Forwarded: https://github.com/nodejs/node/pull/50980 Gbp-Pq: Topic build Gbp-Pq: Name test_runner_escape_path.patch --- diff --git a/test/parallel/test-runner-output.mjs b/test/parallel/test-runner-output.mjs index 372ca8f3b..59d4cef33 100644 --- a/test/parallel/test-runner-output.mjs +++ b/test/parallel/test-runner-output.mjs @@ -15,7 +15,7 @@ function replaceTestDuration(str) { } const color = '(\\[\\d+m)'; -const stackTraceBasePath = new RegExp(`${color}\\(${process.cwd()}/?${color}(.*)${color}\\)`, 'g'); +const stackTraceBasePath = new RegExp(`${color}\\(${process.cwd().replace(/[\\^$*+?.()|[\]{}]/g, '\\$&')}/?${color}(.*)${color}\\)`, 'g'); function replaceSpecDuration(str) { return str