We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c043b88 + 887d70f commit 22d08b5Copy full SHA for 22d08b5
index.js
@@ -26,6 +26,21 @@ class ResembleHelper extends Helper {
26
image1 = this.config.baseFolder + image1;
27
image2 = this.config.screenshotFolder + image2;
28
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
39
40
+ `${image2} ${err.code === 'ENOENT' ? 'screenshot image does not exist' : 'is read-only'}`);
41
42
43
44
return new Promise((resolve, reject) => {
45
46
resemble.outputSettings({
0 commit comments