Open voxpelli opened 3 years ago
Running into big trouble.
Mock-fs works through replacing Nodejs internal binding for fs
.
But in Nodejs v12.12.0+, it introduced another internal binding fs_dir
.
The problem is, the new fs_dir
binding is not exposed to user code.
We could not grab the existing fs_dir
binding through process.binding('fs_dir')
. It means we could not replace/restore it.
@tschaub any idea how to work around this?
From the above linked Nodejs issue, it's unlikely that Nodejs will open up fs_dir
access.
Thanks for looking into it! I guess this becomes a wider issue then, maybe ultimately requiring another approach to patching. Feel free to close this for now if you think that would be out of scope for this.
Thanks for looking into it! I guess this becomes a wider issue then, maybe ultimately requiring another approach to patching. Feel free to close this for now if you think that would be out of scope for this.
@voxpelli how did you solve it?
Noticed that
mock-fs
currently doesn't supportfs.opendir
(added in Node.js12.12.0
), which made one of my modules,list-installed
, not recognize the mocked data which I tried to make it act on in another of my modules.Since I couldn't see a mention of this I thought I should open an issue to keep track of it.