Wednesday, 26 April 2017

Using mock-fs to test for EXDEV errors

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 the 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?

Thanks in advance



via dandanknight

No comments:

Post a Comment