Skip to content

Commit

Permalink
Test: createDiff
Browse files Browse the repository at this point in the history
  • Loading branch information
milesillsley committed Jun 20, 2018
1 parent d1efe38 commit 6e3d300
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/createDiffs.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* globals jest expect */

import looksSame from 'looks-same';
import createDiffImage from './createDiffs';

jest.mock('looks-same', () => {
return { createDiff: jest.fn() };
});

jest.mock('path');

describe('Creating difference images', () => {
beforeEach(() => {});

afterEach(() => {
jest.clearAllMocks();
});

it('checks whether the image data looks the same', () => {
jest.setTimeout(60000);
const comparisonData = {
label: 'test1-large',
baseline: 'testBaseline/test1-large.png',
latest: 'testLatest/test1-large.png',
generatedDiffs: 'testDiff/test1-large.png',
tolerance: 0
};

createDiffImage(comparisonData);
expect(looksSame.createDiff).toHaveBeenCalled();
});
});

0 comments on commit 6e3d300

Please sign in to comment.