Skip to content

Commit 67f4b51

Browse files
committed
add failure threshold
1 parent 9ff7a7d commit 67f4b51

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/visual/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function runDocTest(options, fn) {
2626
const { systemFonts = false } = options;
2727
const images = await pdf2png(pdfData, { systemFonts });
2828
for (let image of images) {
29-
expect(image).toMatchImageSnapshot();
29+
expect(image).toMatchImageSnapshot(options);
3030
}
3131
resolve();
3232
} catch (err) {

tests/visual/text.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ describe('text', function () {
184184
});
185185

186186
test('bounded text precision', function () {
187-
return runDocTest({ systemFonts: true }, function (doc) {
187+
return runDocTest({ systemFonts: true, failureThreshold: 0.05, failureThresholdType: 'percent' }, function (doc) {
188188
const text = 'New york';
189189
const bounds = doc.boundsOfString(text);
190190
doc

0 commit comments

Comments
 (0)