Browse Source

Fixes #130

pull/132/head
james.cryer 7 years ago
parent
commit
dadad3d80d
  1. 23
      nodejs-tests/resemble.test.js
  2. 2
      resemble.js

23
nodejs-tests/resemble.test.js

@ -112,5 +112,28 @@ describe('resemble', () => {
}); });
test('test partial diff with bounding box', () => {
const people = fs.readFileSync('./demoassets/ghost1.png');
const people2 = fs.readFileSync('./demoassets/ghost2.png');
return new Promise(function(resolve, reject) {
resemble.outputSettings({
boundingBox: {
left: 80,
top: 80,
right: 130,
bottom: 130
}
});
resemble(people).compareTo(people2).onComplete(function(data) {
expect(data.misMatchPercentage).toEqual('0.04');
resolve();
});
});
});
}); });

2
resemble.js

@ -633,7 +633,7 @@ URL: https://github.com/Huddle/Resemble.js
function compare(one, two){ function compare(one, two){
if (globalOutputSettings !== oldGlobalSettings) { if (globalOutputSettings !== oldGlobalSettings) {
outputSettings(options); outputSettings(globalOutputSettings);
} }
function onceWeHaveBoth(){ function onceWeHaveBoth(){

Loading…
Cancel
Save