question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrade MockFS for Node.js 11 support

See original GitHub issue

The 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:closed
  • Created 5 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Feb 5, 2019

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.

1reaction
eslint-deprecated[bot]commented, Dec 20, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found