Open HoldYourWaffle opened 4 years ago
Yeah unfortunately fixing this is pretty complicated; doubly so when you factor in the different versions of @types/node
.
It's best just to cast: either when calling use
or if you're keeping the Volume around assign it as an fs
:
ufs
.use(jest.requireActual('fs'))
.use(createFsFromVolume(vol) as any) as any;
const myVolume: typeof fs = (createFsFromVolume(vol) as unknown) as typeof fs;
When I have a chance I'll revisit, but any solution will likely be a breaking change, or at least need a lot of testing & review :(
@G-Rath But isn't it one of the selling point of unionfs to actually be compatible with memfs volumes? I mean, it is in the main README.
When I try to
use
amemfs
Volume
I get the following errors:With strict mode:
Without strict mode: