From: Jérémy Lal Date: Wed, 20 Dec 2023 17:07:36 +0000 (+0100) Subject: test runner output fails on some cwd - fix regexp X-Git-Tag: archive/raspbian/18.19.0+dfsg-6_deb12u1+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b171f447c5c243ba5c205ea0ce0e9d659792d6c8;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