Upgrade MockFS for Node.js 11 support
See original GitHub issueThe problem you want to solve.
A lot of our tests use mock-fs
for mocking out the file system (specifically in linter.js
). We recently started testing ESLint on Node 11, and mock-fs
doesn’t currently work in Node 11, and likely never will.
Your take on the correct solution to problem.
In the short term, it might be best to stop testing in Node 11 to unblock incoming PRs. In the long-term, we probably need to either refactor the tests not to use mock-fs
and/or find another module to replace it.
Are you willing to submit a pull request to implement this change?
Of course.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
mock-fs - npm
The mock-fs module allows Node's built-in fs module to be backed temporarily by an in-memory, mock file system.
Read more >How to mock a dependency in a Node.js, and why you should ...
How to mock a dependency in a Node.js, and why you should do it. ... May be you already use mocking library, and...
Read more >How to Mock `fs.promises.writeFile` with Jest - Stack Overflow
I know that writeFile is actually being called because I ran node -e "require(\"./createFile.js\").createNewFile()" and the file was created.
Read more >File system | Node.js v19.3.0 Documentation
The fs/promises API provides asynchronous file system methods that return promises. The promise APIs use the underlying Node.js threadpool to perform file ...
Read more >Unit testing Node.js fs with mock-fs - Emma Goto
If you're using the fs module to do things like write to files, or modify file names, you might have wondered - how...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It looks like MockFS has actually solved this! https://github.com/tschaub/mock-fs/issues/256#event-2116072325
So I think we can revert the test change and upgrade MockFS.
Unfortunately, it looks like there wasn’t enough interest from the team or community to implement this change. While we wish we’d be able to accommodate everyone’s requests, we do need to prioritize. We’ve found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn’t mean the idea isn’t interesting or useful, just that it’s not something the team can commit to.
Thanks for contributing to ESLint and we appreciate your understanding.