Skip to content

Commit

Permalink
Merge pull request #28 from chrisdeely/default-highlight-color
Browse files Browse the repository at this point in the history
supply a default highlight color for createDiff. fixes #27
  • Loading branch information
sipayRT committed Mar 22, 2019
2 parents 5fb3974 + 4766f56 commit 229a14c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -94,7 +94,7 @@ const buildDiffImage = (png1, png2, options, callback) => {
};

const parseColorString = (str) => {
const parsed = parseColor(str);
const parsed = parseColor(str || '#ff00ff');

return {
R: parsed.rgb[0],
Expand Down
14 changes: 14 additions & 0 deletions test/test.js
Expand Up @@ -493,6 +493,20 @@ describe('createDiff', () => {
});
});

it('should provide a default highlight color', (done) => {
const _this = this;
looksSame.createDiff({
reference: srcPath('ref.png'),
current: srcPath('different.png'),
diff: this.tempName
}, () => {
looksSame(imagePath('diffs/small-magenta.png'), _this.tempName, (error, equal) => {
expect(equal).to.equal(true);
done();
});
});
});

it('should allow to build diff for taller images', (done) => {
const _this = this;
looksSame.createDiff({
Expand Down

0 comments on commit 229a14c

Please sign in to comment.