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
kapouer and aduh95 authored Dec 5, 2023
1 parent 5504cf3 commit fba2c93
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 fba2c93

Please sign in to comment.