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 <duhamelantoine1995@gmail.com>
PR-URL: #50980
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
2 people authored and richardlau committed Mar 25, 2024
1 parent 1113e58 commit a4f1805
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 a4f1805

Please sign in to comment.