Skip to content

Commit 3da8d5c

Browse files
committed
fixup! test: unify assertSnapshot common patterns
1 parent 1f76732 commit 3da8d5c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/common/assertSnapshot.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@ function replaceWarningPid(str) {
6060
// The project root path may contain unicode characters.
6161
function transformProjectRoot(replacement = '<project-root>') {
6262
const projectRoot = path.resolve(__dirname, '../..');
63+
// Handles output already processed by `replaceWindowsPaths`.
64+
const winPath = replaceWindowsPaths(projectRoot);
6365
// Handles URL encoded project root in file URL strings as well.
6466
const urlEncoded = pathToFileURL(projectRoot).pathname;
6567
return (str) => {
6668
return str.replaceAll('\\\'', "'")
6769
.replaceAll(projectRoot, replacement)
70+
.replaceAll(winPath, replacement)
6871
.replaceAll(urlEncoded, replacement);
6972
};
7073
}

0 commit comments

Comments
 (0)