-
Notifications
You must be signed in to change notification settings - Fork 325
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
Add non-mocked test for symlink #1308
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just a little bit concerned because the new tests don't pass on Windows which is why createSymlink has been created and as I'm on Windows it will make my life harder to check I'm not introducing regression
Ok, I added a mocked test on linux, where I just fail the And in the other tests, instead of Hopefully the tests will now work for you on windows with those changes (and linux at the same time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. But there are changes in XetBlob that seem unrelated
...(await importOriginal<typeof import("node:fs/promises")>()), | ||
symlink: async (...args: any[]) => { | ||
if (failSymlink) { | ||
failSymlink = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure to get why we are changing the flag here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's to reset the function once it's called. (so it doesn't impact other tests)
Could be done more elegantly
Alternative to #1307
Fix #1306
I was just too confused by the src/dst params, nodej's official docs could be clearer too.
Now the params are explictly named and there is a real test to check the filesystem contents.
By the way, it's a
copy
operation not arename
(because it was already the case, thenew_blob
param was never passed)Also took the opportunty to use relative symlinks cc @Wauplin for better windows support
cc @jeffmaury @axel7083