Skip to content

Commit 02b34ce

Browse files
committed
feat: Output debug 'actual' PDFs
1 parent a3ee426 commit 02b34ce

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
node_modules/
55
coverage/
66
npm-debug.log
7+
test/actual/*.pdf

test/actual/.gitkeep

Whitespace-only changes.

test/utils/compare.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,12 @@ globalVar.comparePdf = function(actual, expectedFile, suite) {
401401
const differences = compareArrays(actualLines, expectedLines);
402402

403403
if (differences.length > 0) {
404+
// Save the actual PDF for debugging
405+
globalVar.sendReference(
406+
"/test/actual/" + expectedFile,
407+
resetFile(actual)
408+
);
404409
const message = formatDifferences(differences);
405-
fail(`PDF comparison failed:${message}`);
410+
fail(`PDF comparison failed:${message}\nActual PDF saved to: test/actual/${expectedFile}`);
406411
}
407412
};

0 commit comments

Comments
 (0)