Skip to content

Commit abb9685

Browse files
authored
Fix bug - baseline and comparison images write mode (#75) (#76)
1 parent fad954b commit abb9685

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,19 @@ class ResembleHelper extends Helper {
4242
const actualImage = this.screenshotFolder + image;
4343

4444
// check whether the base and the screenshot images are present.
45-
fs.access(baseImage, fs.constants.F_OK | fs.constants.W_OK, (err) => {
45+
fs.access(baseImage, fs.constants.F_OK | fs.constants.R_OK, (err) => {
4646
if (err) {
4747
throw new Error(
48-
`${baseImage} ${err.code === 'ENOENT' ? 'base image does not exist' : 'is read-only'}`);
48+
`${baseImage} ${err.code === 'ENOENT' ? 'base image does not exist' :
49+
'base image has an access error'}`);
4950
}
5051
});
5152

52-
fs.access(actualImage, fs.constants.F_OK | fs.constants.W_OK, (err) => {
53+
fs.access(actualImage, fs.constants.F_OK | fs.constants.R_OK, (err) => {
5354
if (err) {
5455
throw new Error(
55-
`${actualImage} ${err.code === 'ENOENT' ? 'screenshot image does not exist' : 'is read-only'}`);
56+
`${actualImage} ${err.code === 'ENOENT' ? 'screenshot image does not exist' :
57+
'screenshot image has an access error'}`);
5658
}
5759
});
5860

0 commit comments

Comments
 (0)