@@ -26,7 +26,6 @@ else runSingle(userFileName);
26
26
function runAll ( ) {
27
27
test ( 'testing mocks' , function ( t ) {
28
28
29
- console . error ( '### beginning pixel comparison tests ###' ) ;
30
29
var files = fs . readdirSync ( constants . pathToTestImageMocks ) ;
31
30
32
31
// -1 for font-wishlist and
@@ -70,7 +69,6 @@ function testMock (fileName, t) {
70
69
var diffPath = path . join ( constants . pathToTestImagesDiff , 'diff-' + imageFileName ) ;
71
70
var savedImageStream = fs . createWriteStream ( savedImagePath ) ;
72
71
var options = getOptions ( bodyMock , 'http://localhost:9010/' ) ;
73
- var statusCode ;
74
72
75
73
function checkImage ( ) {
76
74
var options = {
@@ -79,17 +77,12 @@ function testMock (fileName, t) {
79
77
tolerance : 0.0
80
78
} ;
81
79
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
+ ) ;
93
86
}
94
87
95
88
function onEqualityCheck ( err , isEqual ) {
@@ -99,16 +92,12 @@ function testMock (fileName, t) {
99
92
}
100
93
if ( isEqual ) {
101
94
fs . unlinkSync ( diffPath ) ;
102
- console . error ( imageFileName + ' is pixel perfect' ) ;
103
95
}
104
96
105
- t . ok ( isEqual , savedImagePath + ' should be pixel perfect' ) ;
97
+ t . ok ( isEqual , imageFileName + ' should be pixel perfect' ) ;
106
98
}
107
99
108
100
request ( options )
109
- . on ( 'response' , function ( response ) {
110
- statusCode = response . statusCode ;
111
- } )
112
101
. pipe ( savedImageStream )
113
102
. on ( 'close' , checkImage ) ;
114
103
}
0 commit comments