-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENOENT error encountered while using fileNameFormatter feature #229
Comments
It works for flat structure, so there's definitely a bug related to missing directories when creating diff. +1 cause this currently makes using |
After a short research I think I found it: Loki uses The reason why saving reference and current images works in Loki is because Loki saves them itself using That's a tough one then - seems like the best option would be to ask |
+1 opened an issue to 'looks-same', feel free to elaborate there, +1 or comment |
@alonseg A link wouldn't hurt 😉 |
@jalooc sure, I just thought you can see here my mention :) |
Ran into this problem recently while using fileNameFormatter({configurationName, kind, story}) {
return `components/${kind}/__references__/${configurationName}/${story.toLowerCase()}`;
}
Maybe Loki should create path to the difference image before calling differ and then just remove it if there is no any difference? BTW, |
@kirilldronkin in the looks-same case I don't think we even need the removal part, we can create the path only if it is not the same. I can create the PR but I'd like to hear @oblador opinion first to know if he'll approve it |
I think a better approach would be to write the diff to a temp dir and then move it if there is a diff. Otherwise we'd end up with a bunch of empty directories. |
For anyone stumbling on this, here's a workound using
|
DESCRIPTION:
The following error is encountered when running into an image with valid difference from baseline:
STEPS TO REPLICATE:
Set the following attribute in loki.config.js:
fileNameFormatter: ({ configurationName, kind, story }) =
${configurationName}/${kind}_${story}.toLowerCase()
EXPECTED RESULT:
An image is different error is encountered
Difference is shown on the difference folder
ACTUAL RESULT:
ENOENT error is encountered
No image gets saved on the difference folder
NOTE:
Haven't tested on a flat file structure since our storybook instance have folders set up in them
The text was updated successfully, but these errors were encountered: