tschaub / mock-fs

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

mock-fs@3 broken in node.js 6.10.1+ and 7.7.0+ #203

Open papandreou opened 7 years ago

papandreou commented 7 years ago

Ran into this error with mock-fs 3.12.1, the latest 3.x release: https://travis-ci.org/papandreou/fileception/jobs/220931111#L600-L610

It happens with node.js 6.10.1+ (but not 6.10.0) and 7.7.0 (but not 7.6.0).

The most likely culprit is https://github.com/nodejs/node/pull/11522/files, which was the only fs-related change to land in both releases.

Tried a naive fix that makes the problem go away, but seems to cause problems elsewhere.

I can't upgrade to mock-fs@4 for now because of require('mock-fs').fs being removed.

Slayer95 commented 7 years ago

I forked v3 as mock-fs-require-fix a while back in order to get #145 fixed. I have just added support of the newest Node v6 and v7 releases.

papandreou commented 7 years ago

@Slayer95, thanks a lot for doing that and letting me know. It seems to work great, and allowed me to fix the unexpected-fs and fileception modules in those new node.js 6 and 7 releases.