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?
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()
. Ifa
orb
are on a different device (such as an NFS mount) then my code picks up theEXDEV
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