Skip to content

Commit babe27b

Browse files
committed
fix: tmpdir normalization now matches files directly under tmpdir
The regex required a trailing slash after the path segment, missing files placed directly in tmpdir (e.g., screenshot temp files).
1 parent c1fb440 commit babe27b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/snapshot-tests/normalize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ export function normalizeSnapshotOutput(text: string): string {
9999

100100
const tmpDir = os.tmpdir();
101101
normalized = normalized.replace(
102-
new RegExp(escapeRegex(tmpDir) + '/[A-Za-z0-9._-]+/', 'g'),
103-
'<TMPDIR>/',
102+
new RegExp(escapeRegex(tmpDir) + '/[A-Za-z0-9._-]+(?=/|[^A-Za-z0-9._/-]|$)', 'g'),
103+
'<TMPDIR>',
104104
);
105105

106106
normalized = normalized.replace(DERIVED_DATA_HASH_REGEX, '$1-<HASH>');

0 commit comments

Comments
 (0)