From 5cfa53d312176a411a283f53202fc1e67ebb1909 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9my=20Lal?= Date: Sun, 3 Dec 2023 22:41:14 +0100 Subject: [PATCH] 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 --- test/parallel/test-runner-output.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.30.2