Skip to content

Commit 381c9a7

Browse files
committed
fix: allow snapshot path matching when followed by a slash
1 parent 975d553 commit 381c9a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/common/assertSnapshot.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ function transformPath(dirname, replacement) {
116116
const escapedWinPath = RegExp.escape(winPath);
117117

118118
// Use negative lookahead to prevent matching if followed by alphanumeric or underscore
119-
const urlEncodedRegex = new RegExp(escapedUrlEncoded + '(?![\\w/])', flags);
120-
const dirnameRegex = new RegExp(escapedDirname + '(?![\\w/])', flags);
121-
const winPathRegex = new RegExp(escapedWinPath + '(?![\\w/])', flags);
119+
const urlEncodedRegex = new RegExp(escapedUrlEncoded + '(?![\\w])', flags);
120+
const dirnameRegex = new RegExp(escapedDirname + '(?![\\w])', flags);
121+
const winPathRegex = new RegExp(escapedWinPath + '(?![\\w])', flags);
122122

123123
return (str) => {
124124
return str.replaceAll('\\\'', "'")

0 commit comments

Comments
 (0)