Skip to content

Commit a4f1805

Browse files
kapoueraduh95
authored andcommittedMar 25, 2024
test: escape cwd in regexp
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]>
1 parent 1113e58 commit a4f1805

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎test/parallel/test-runner-output.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function replaceTestDuration(str) {
1515
}
1616

1717
const color = '(\\[\\d+m)';
18-
const stackTraceBasePath = new RegExp(`${color}\\(${process.cwd()}/?${color}(.*)${color}\\)`, 'g');
18+
const stackTraceBasePath = new RegExp(`${color}\\(${process.cwd().replaceAll(/[\\^$*+?.()|[\]{}]/g, '\\$&')}/?${color}(.*)${color}\\)`, 'g');
1919

2020
function replaceSpecDuration(str) {
2121
return str

0 commit comments

Comments
 (0)