Skip to content

Commit 1dc2a01

Browse files
committed
clean up compare pixel test logs
1 parent 3b0e6ab commit 1dc2a01

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

test/image/compare_pixels_test.js

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ else runSingle(userFileName);
2626
function runAll () {
2727
test('testing mocks', function (t) {
2828

29-
console.error('### beginning pixel comparison tests ###');
3029
var files = fs.readdirSync(constants.pathToTestImageMocks);
3130

3231
// -1 for font-wishlist and
@@ -70,7 +69,6 @@ function testMock (fileName, t) {
7069
var diffPath = path.join(constants.pathToTestImagesDiff, 'diff-' + imageFileName);
7170
var savedImageStream = fs.createWriteStream(savedImagePath);
7271
var options = getOptions(bodyMock, 'http://localhost:9010/');
73-
var statusCode;
7472

7573
function checkImage () {
7674
var options = {
@@ -79,17 +77,12 @@ function testMock (fileName, t) {
7977
tolerance: 0.0
8078
};
8179

82-
if(statusCode === 485) {
83-
console.error(imageFileName, '- skip');
84-
}
85-
else {
86-
gm.compare(
87-
savedImagePath,
88-
path.join(constants.pathToTestImageBaselines, imageFileName),
89-
options,
90-
onEqualityCheck
91-
);
92-
}
80+
gm.compare(
81+
savedImagePath,
82+
path.join(constants.pathToTestImageBaselines, imageFileName),
83+
options,
84+
onEqualityCheck
85+
);
9386
}
9487

9588
function onEqualityCheck (err, isEqual) {
@@ -99,16 +92,12 @@ function testMock (fileName, t) {
9992
}
10093
if (isEqual) {
10194
fs.unlinkSync(diffPath);
102-
console.error(imageFileName + ' is pixel perfect');
10395
}
10496

105-
t.ok(isEqual, savedImagePath + ' should be pixel perfect');
97+
t.ok(isEqual, imageFileName + ' should be pixel perfect');
10698
}
10799

108100
request(options)
109-
.on('response', function(response) {
110-
statusCode = response.statusCode;
111-
})
112101
.pipe(savedImageStream)
113102
.on('close', checkImage);
114103
}

0 commit comments

Comments
 (0)