-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
existsSync throws an error instead of returning false in Node 11 #256
Comments
#254 (comment) |
This is a workaround for tschaub/mock-fs#256. It seems like we might eventually need to find an alternative to mock-fs for future Node versions, but this workaround should make the build pass in the meantime.
This is a workaround for tschaub/mock-fs#256. It seems like we might eventually need to find an alternative to mock-fs for future Node versions, but this workaround should make the build pass in the meantime.
Ah, thanks for the heads up.
…On Sat, Nov 17, 2018 at 2:52 AM Maxwell Gerber ***@***.***> wrote:
#254 (comment)
<#254 (comment)>
I'm not the maintainer for this library so take this with a grain of salt
- I don't think mock-fs as it is currently implemented will ever support
Node 11+.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#256 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACWkprdfYK0JoPXdPC-Nn0f8YlhI7fRks5uv-pbgaJpZM4YnAr3>
.
--
______________________________
Nicholas C. Zakas
@SlickNet
Author, Principles of Object-Oriented JavaScript <http://amzn.to/29Pmfrm>
Author, Understanding ECMAScript 6 <http://amzn.to/29K1mIy>
|
This has found its way into (v10.14.2 LTS) independent of making |
Same issue with node 10.14.2 - mock-fs |
… to fs.existsSync introduced in later node 10 versions
For those interested, currently using this as a workaround: No idea whether that is a good fix or not so YMMV |
Related issue: tschaub/mock-fs#256
Awesome, thank you! |
Related issue: tschaub/mock-fs#256
Prior to 4.8.0 there was an issue with mock-fs' implementation of existsSync throwing an exception under node 10+ instead of returning false when a mocked file didn't exist. See tschaub/mock-fs#256
* Update package.json to allow usage by modern node Change the node engines to remove the upper limit * Update mock-fs dependency Prior to 4.8.0 there was an issue with mock-fs' implementation of existsSync throwing an exception under node 10+ instead of returning false when a mocked file didn't exist. See tschaub/mock-fs#256 * Add node 14 to the travis config
Environment Info:
MockFS version: 4.7.0
We recently found one test using
mock-fs
that fails consistently in Node.js v11:https://travis-ci.org/eslint/eslint/jobs/456094527#L484
This occurs because
existsSync
ends up throwing an error instead of returningfalse
(which it does consistently in other Node.js versions).The test in question looks like this:
The first test passes while the second one throws an error in Node.js 11 (Node.js 6, 8, and 10 all pass).
npmUtils.checkPackageJson()
callsfs.existsSync
under the covers.The text was updated successfully, but these errors were encountered: