File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,21 @@ class ResembleHelper extends Helper {
2626 image1 = this . config . baseFolder + image1 ;
2727 image2 = this . config . screenshotFolder + image2 ;
2828
29+ // check whether the base and the screenshot images are present.
30+ fs . access ( image1 , fs . constants . F_OK | fs . constants . W_OK , ( err ) => {
31+ if ( err ) {
32+ throw new Error (
33+ `${ image1 } ${ err . code === 'ENOENT' ? 'base image does not exist' : 'is read-only' } ` ) ;
34+ }
35+ } ) ;
36+
37+ fs . access ( image2 , fs . constants . F_OK | fs . constants . W_OK , ( err ) => {
38+ if ( err ) {
39+ throw new Error (
40+ `${ image2 } ${ err . code === 'ENOENT' ? 'screenshot image does not exist' : 'is read-only' } ` ) ;
41+ }
42+ } ) ;
43+
2944 return new Promise ( ( resolve , reject ) => {
3045
3146 resemble . outputSettings ( {
You can’t perform that action at this time.
0 commit comments