Closed mattdeluco closed 4 years ago
Sorry, reading through the NodeJS API docs for fs
I noticed that readFile()
should return an error if the file is a directory. Which is odd, because I've got code that seems to work when I use readFileSync()
to loop over directory contents (which is why I posted here before checking the Node API.)
There is still a small mismatch, Nodejs fails EISDIR
not EBADF
when reading dir, at least for nodejs v12. I will follow up.
The attached mocha test will fail with
Error: EBADF: bad file descriptor, read
.While searching the issues I noticed some relating to graceful-fs - while it's technically in my node_modules dependency tree, I don't believe it's loaded during the test. I think it's only used for the vscode eslint extension.
This is on macOS 10.15.2, Node 12.14.0, mock-fs 4.10.4.