@@ -29,8 +29,6 @@ exec('monit restart nw1 && sleep 5', function() {
29
29
30
30
function runAll ( ) {
31
31
test ( 'testing mocks' , function ( t ) {
32
-
33
- console . error ( '### beginning pixel comparison tests ###' ) ;
34
32
var files = fs . readdirSync ( constants . pathToTestImageMocks ) ;
35
33
36
34
// -1 for font-wishlist and
@@ -74,7 +72,6 @@ function testMock (fileName, t) {
74
72
var diffPath = path . join ( constants . pathToTestImagesDiff , 'diff-' + imageFileName ) ;
75
73
var savedImageStream = fs . createWriteStream ( savedImagePath ) ;
76
74
var options = getOptions ( bodyMock , 'http://localhost:9010/' ) ;
77
- var statusCode ;
78
75
79
76
function checkImage ( ) {
80
77
var options = {
@@ -83,17 +80,12 @@ function testMock (fileName, t) {
83
80
tolerance : 0.0
84
81
} ;
85
82
86
- if ( statusCode === 485 ) {
87
- console . error ( imageFileName , '- skip' ) ;
88
- }
89
- else {
90
- gm . compare (
91
- savedImagePath ,
92
- path . join ( constants . pathToTestImageBaselines , imageFileName ) ,
93
- options ,
94
- onEqualityCheck
95
- ) ;
96
- }
83
+ gm . compare (
84
+ savedImagePath ,
85
+ path . join ( constants . pathToTestImageBaselines , imageFileName ) ,
86
+ options ,
87
+ onEqualityCheck
88
+ ) ;
97
89
}
98
90
99
91
function onEqualityCheck ( err , isEqual ) {
@@ -103,19 +95,15 @@ function testMock (fileName, t) {
103
95
}
104
96
if ( isEqual ) {
105
97
fs . unlinkSync ( diffPath ) ;
106
- console . error ( imageFileName + ' is pixel perfect' ) ;
107
98
}
108
99
109
- t . ok ( isEqual , savedImagePath + ' should be pixel perfect' ) ;
100
+ t . ok ( isEqual , imageFileName + ' should be pixel perfect' ) ;
110
101
}
111
102
112
103
request ( options )
113
- . on ( 'response' , function ( response ) {
114
- statusCode = response . statusCode ;
115
- } )
116
104
. pipe ( savedImageStream )
117
- . on ( 'close' , checkImage ) ;
118
105
. on ( 'error' , function ( ) {
119
106
console . log ( "NOOOOOOOOOOOOO" )
120
107
} )
108
+ . on ( 'close' , checkImage ) ;
121
109
}
0 commit comments