tschaub / mock-fs

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

fs.statSync no longer mocked from NodeJS 20.8.0 #380

Open andrewnicols opened 1 year ago

andrewnicols commented 1 year ago

Mocking with mock-fs and call fs.statSync no longer mocks from v20.8.0 https://nodejs.org/en/blog/release/v20.8.0

I believe this is due to performance improvements in fs.*Sync methods from this commit: https://github.com/nodejs/node/pull/49593/files#diff-9b2c5bf36570be7a09ba2597abdf6d9bc2cc1e19866b6674b0cf275c1188dcad

All *Sync commans hae moved to syncFs.

Sayan751 commented 12 months ago

I am also facing issues on Node 20 with exists*.

fregante commented 11 months ago

This pushed me to just use async methods instead of *Sync. Those work perfectly in Node 20 with mock-fs 🎉

Sayan751 commented 11 months ago

This pushed me to just use async methods instead of *Sync. Those work perfectly in Node 20 with mock-fs 🎉

Thanks @fregante! This works!