@@ -151,11 +151,8 @@ describe('state-processor/capture-processor/capture-processor', () => {
151151 temp . path . withArgs ( { suffix : '.png' } ) . returns ( '/temp/path' ) ;
152152 fs . readFileSync . withArgs ( '/ref/path' ) . returns ( 'ref-buffer-data' ) ;
153153
154- const refImage = mkImage ( { size : { width : 100 , height : 200 } } ) ;
155- Image . create . withArgs ( 'ref-buffer-data' ) . returns ( refImage ) ;
156-
157154 const currImage = mkImage ( { size : { width : 100 , height : 200 } } ) ;
158- Image . compare . resolves ( { equal : true } ) ;
155+ Image . compare . resolves ( { equal : true , metaInfo : { refImg : { size : { width : 100 , height : 200 } } } } ) ;
159156 return exec_ ( { refImg : { path : '/ref/path' , size : null } } , { image : currImage } )
160157 . then ( ( result ) => {
161158 assert . deepEqual ( result , {
@@ -167,13 +164,14 @@ describe('state-processor/capture-processor/capture-processor', () => {
167164 } ) ;
168165
169166 it ( 'different' , ( ) => {
170- Image . compare . resolves ( { equal : false , diffBounds : { left : 0 , top : 0 , right : 10 , bottom : 10 } } ) ;
167+ Image . compare . resolves ( {
168+ equal : false ,
169+ diffBounds : { left : 0 , top : 0 , right : 10 , bottom : 10 } ,
170+ metaInfo : { refImg : { size : { width : 100 , height : 200 } } }
171+ } ) ;
171172 temp . path . withArgs ( { suffix : '.png' } ) . returns ( '/temp/path' ) ;
172173 fs . readFileSync . withArgs ( '/ref/path' ) . returns ( 'ref-buffer-data' ) ;
173174
174- const refImage = mkImage ( { size : { width : 100 , height : 200 } } ) ;
175- Image . create . withArgs ( 'ref-buffer-data' ) . returns ( refImage ) ;
176-
177175 const currImage = mkImage ( { size : { width : 300 , height : 400 } } ) ;
178176
179177 return exec_ ( { refImg : { path : '/ref/path' , size : null } } , { image : currImage } )
@@ -203,11 +201,11 @@ describe('state-processor/capture-processor/capture-processor', () => {
203201 const refImage = mkImage ( { size : { width : 100 , height : 200 } } ) ;
204202 Image . create . withArgs ( 'existent-buffer-data' ) . returns ( refImage ) ;
205203
206- return exec_ ( { refImg : { path : '/existent/path' , size : null } } )
204+ return exec_ ( { refImg : { path : '/existent/path' } } )
207205 . then ( ( res ) => {
208206 assert . notCalled ( utils . saveRef ) ;
209207 assert . deepEqual ( res , {
210- refImg : { path : '/existent/path' , size : { width : 100 , height : 200 } } ,
208+ refImg : { path : '/existent/path' } ,
211209 updated : false
212210 } ) ;
213211 } ) ;
@@ -289,9 +287,7 @@ describe('state-processor/capture-processor/capture-processor', () => {
289287 it ( 'should not update a reference image if images are the same' , ( ) => {
290288 fs . readFileSync . withArgs ( '/ref/path' ) . returns ( 'ref-buffer-data' ) ;
291289
292- const refImage = mkImage ( { size : { width : 100 , height : 200 } } ) ;
293- Image . create . withArgs ( 'ref-buffer-data' ) . returns ( refImage ) ;
294- Image . compare . resolves ( { equal : true } ) ;
290+ Image . compare . resolves ( { equal : true , metaInfo : { refImg : { size : { width : 100 , height : 200 } } } } ) ;
295291 return exec_ ( { refImg : { path : '/ref/path' , size : null } } )
296292 . then ( ( res ) => {
297293 assert . notCalled ( utils . copyImg ) ;
@@ -333,12 +329,11 @@ describe('state-processor/capture-processor/capture-processor', () => {
333329 utils . copyImg . resolves ( false ) ;
334330
335331 fs . readFileSync . withArgs ( '/ref/path' ) . returns ( 'ref-buffer-data' ) ;
336- const refImage = mkImage ( { size : { width : 100 , height : 200 } } ) ;
337- Image . create . withArgs ( 'ref-buffer-data' ) . returns ( refImage ) ;
338332
333+ Image . compare . resolves ( { metaInfo : { refImg : { size : { width : 100 , height : 200 } } } } ) ;
339334 const currImage = mkImage ( { size : { width : 300 , height : 400 } } ) ;
340335
341- return exec_ ( { refImg : { path : '/ref/path' , size : null } } , { image : currImage } )
336+ return exec_ ( { refImg : { path : '/ref/path' } } , { image : currImage } )
342337 . then ( ( res ) => {
343338 assert . deepEqual ( res , {
344339 refImg : { path : '/ref/path' , size : { width : 100 , height : 200 } } ,
0 commit comments