Skip to content

Commit

Permalink
use an abstraction to display images or not in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
steren committed Feb 15, 2013
1 parent 8db5a00 commit f1bb084
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/test/anomalies.spec.js
Expand Up @@ -8,6 +8,14 @@ define([
'specutils'
], function (GOOH, SpecUtils) {

var displayImages = true;

var displayImage = function(img) {
if(displayImages) {
document.body.appendChild(img);
}
};

describe("Image merging", function() {
it("should be able to take a part of one image using a mask and merge it on another", function() {
// create first image on which to paste something
Expand Down Expand Up @@ -43,11 +51,11 @@ define([
var img2ctx = img2.getContext('2d');
img2ctx.fillStyle = 'rgb(255, 255, 255)';
img2ctx.fillRect(diffParams.x, diffParams.y, diffParams.width, diffParams.heigth);
//document.body.appendChild(img1);
//document.body.appendChild(img2);
displayImage(img1);
displayImage(img2);

var result = SpecUtils.newEmptyCanvas();
//document.body.appendChild(result);
displayImage(result);

GOOH.diff(img1, img2, 5, result);

Expand Down

0 comments on commit f1bb084

Please sign in to comment.