Skip to content

Commit

Permalink
test: escape cwd in regexp
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <[email protected]>
PR-URL: #50980
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
2 people authored and RafaelGSS committed Dec 15, 2023
1 parent 95d8a27 commit 4ddd0da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-runner-output.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ddd0da

Please sign in to comment.