Skip to content
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

Mocking multiple FS for testing EXDEV #206

Open
dandanknight opened this issue Apr 27, 2017 · 0 comments
Open

Mocking multiple FS for testing EXDEV #206

dandanknight opened this issue Apr 27, 2017 · 0 comments

Comments

@dandanknight
Copy link

Hi, apologies for asking in the issues, but I've had no luck elsewhere.

I have a function that moves a file from a -> b using node's fs.rename(). If a or b are on a different device (such as an NFS mount) then my code picks up the EXDEV error, and performs a copy and deletes the source file instead.

I'm looking to use mock-fs to mock the filesystem for testing purposes, and I'm wondering if anybody here knows how I can simulate an EXDEV error using it?

For instance, can I create 2 mock filesystems, and attempt a move between them to achieve this?

Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant