tschaub / mock-fs

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

Add support for fs.watch(). #308

Open dpryden opened 4 years ago

dpryden commented 4 years ago

This support currently only works for Node v10 and newer, since the fs_event_wrap native binding is lazy-loaded and thus can be pre-patched before first use.

To make this robust enough to actually use, it may be necessary to also add in monkeypatching of the fs.watch endpoint.

The tests are incomplete; mainly just enough to demonstrate that this works as a proof of concept.