Skip to content

Commit 3631481

Browse files
committed
feat: snapshot
1 parent 71c085a commit 3631481

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "regressify",
3-
"version": "1.8.12",
3+
"version": "1.8.13",
44
"description": "Visual regression tests support",
55
"main": "src/index.ts",
66
"type": "module",

src/snapshot.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@ function processTestSuite(backstopDir: string, config: Config, hashes: Record<st
8787
}
8888
}
8989
}
90+
91+
if (test?.pair?.diffImage) {
92+
const diffImagePath = path.join(bitmapTestDir, test.pair.diffImage);
93+
if (fs.existsSync(diffImagePath)) {
94+
if (!hashes[test.pair.diffImage]) {
95+
const hash = calculateFileHash(diffImagePath);
96+
hashes[test.pair.diffImage] = hash;
97+
console.log(`Calculated hash for diff image: ${test.pair.diffImage} => ${hash}`);
98+
}
99+
}
100+
}
90101
});
91102
}
92103

0 commit comments

Comments
 (0)