mock-fs compatibility
See original GitHub issueEnvironment
- OS Version: macOS 10.13.3
- Node.js Version: 8.9.4
Actual behavior
I’ve written a gulp-like file transformer to glob for files, read them, modify them, and write them back to the file system. I’ve also included delete functionality. As this functionality can be highly dangerous when there’s a bug, I test using mock-fs
.
I had been using globby
, but switched to using fast-glob directly. When I was using globby v7 (backed by node-glob) I was able to use mock-fs. Now, using fast-glob, I get ENOENT errors thrown.
Expected behavior
Allow file-system to be mocked for testing using something like mock-fs
or by passing a mock file system object to fast-glob as an option.
Steps to reproduce
- git clone https://github.com/shannonmoeller/ygor.git
- cd ygor
- npm it
Sample Code
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
mock-fs - npm
A configurable mock file system. You know, for testing.. Latest version: 5.2.0, last published: 2 months ago. Start using mock-fs in your ...
Read more >tschaub/mock-fs: Configurable mock for the fs module - GitHub
Note mock-fs is not compatible with graceful-fs@3.x but works with graceful-fs@4.x . Mock file access is controlled based on file mode where process.getuid() ......
Read more >node_modules/mock-fs - GitLab
The mock-fs module allows Node's built-in fs module to be backed ... Note mock-fs is not compatible with graceful-fs@3.x but works with ...
Read more >Unit testing Node.js fs with mock-fs - Emma Goto
In this post I'll be showing you how you can use mock-fs to easily unit test your Node.js scripts. If you want to...
Read more >pyfakefs - PyPI
Compatibility. pyfakefs works with CPython 3.7 and above, on Linux, Windows and macOS, and with PyPy3. pyfakefs works with pytest version 3.0.0 or...
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
nvm, it may well have been a change in mock-fs but I went ahead and bumped the
use
package in snapdragon and published 0.8.2 with that change. You will need to reinstall everything and to make sure NPM uses that version you’ll also need to delete package-lock.json files.Confirming this update fixed the issue. Thanks again!