tschaub / mock-fs

Configurable mock for the fs module
https://npmjs.org/package/mock-fs
Other
906 stars 86 forks source link

Add support for Node.js v16.3.0+ #335

Closed Rugvip closed 2 years ago

Rugvip commented 2 years ago

Hoping to fix #332 with this

Large parts of the implementation in readfilecontext.js are copied straight from the Node.js internals. I'm assuming that is all fine as it's already called out in the licence file that parts of this project are copied from there.

3cp commented 2 years ago

Awesome trick! Thank you very much for stretching the life of mock-fs.

tschaub commented 2 years ago

Thanks for the work on this, @Rugvip.

Is there a test that could be added that would cover this? I haven't been experiencing the issue myself, so am not 100% clear on the specifics.

3cp commented 2 years ago

@tschaub the existing mock-fs main branch fails test on latest Nodejs v16.

Rugvip commented 2 years ago

@3cp @tschaub No worries, glad to help!

I added in a couple of tests, so the coverage of readfilecontext.js is now pretty good. Discovered some bugs too :grin:

tschaub commented 2 years ago

Thank you for the contribution, @Rugvip.