diff --git a/test/parallel/test-runner-output.mjs b/test/parallel/test-runner-output.mjs index 0e41ff101b843f..e40ce896bff465 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().replaceAll(/[\\^$*+?.()|[\]{}]/g, '\\$&')}/?${color}(.*)${color}\\)`, 'g'); function replaceSpecDuration(str) { return str