From: Jérémy Lal Date: Tue, 9 Jul 2024 15:36:33 +0000 (+0200) Subject: test runner output fails on some cwd - fix regexp X-Git-Tag: archive/raspbian/18.20.4+dfsg-1_deb12u1+rpi1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ff583d0c411b8e13148e6fcf4df7413453db2e78;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