diff --git a/nodejs-tests/resemble.test.js b/nodejs-tests/resemble.test.js index a50a92d..3ea4b17 100644 --- a/nodejs-tests/resemble.test.js +++ b/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(); + }); + }); + }); + + }); diff --git a/resemble.js b/resemble.js index 7ba0b0d..2b9d763 100644 --- a/resemble.js +++ b/resemble.js @@ -633,7 +633,7 @@ URL: https://github.com/Huddle/Resemble.js function compare(one, two){ if (globalOutputSettings !== oldGlobalSettings) { - outputSettings(options); + outputSettings(globalOutputSettings); } function onceWeHaveBoth(){