Skip to content

Commit

Permalink
test(screenshot-testing): set failureThreshold to 2% to cover text fuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
thatkookooguy committed Dec 25, 2019
1 parent 4d7d575 commit 46fddb1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/image-maker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ const FONT_PATH = '../Comfortaa-Regular.ttf';
const HEIGHT = 534;
const WIDTH = 1069;

const customConfig = { threshold: 0.5 };
const customConfig = {
customDiffConfig: { threshold: 0.5 },
failureThreshold: 0.02,
failureThresholdType: 'percent'
};

describe('image maker', () => {
it('should generate svg string with params', async () => {
Expand Down Expand Up @@ -85,9 +89,7 @@ describe('image maker', () => {

// writeFile('na.png', pngBuffer);

(expect(pngBuffer) as any).toMatchImageSnapshot({
customDiffConfig: customConfig
});
(expect(pngBuffer) as any).toMatchImageSnapshot(customConfig);
});

it('should generate changelog from html template', async () => {
Expand Down Expand Up @@ -127,8 +129,6 @@ describe('image maker', () => {

// await writeFile('nice.svg', pngBuffer);

(expect(pngBuffer) as any).toMatchImageSnapshot({
customDiffConfig: customConfig
});
(expect(pngBuffer) as any).toMatchImageSnapshot(customConfig);
});
});

0 comments on commit 46fddb1

Please sign in to comment.