I'm trying to implement a unit testing platform, a unit test automated runner, in a way that tests can be debugged, and this way involves clearing as many resources as possible between each test run, for example require.cache.
The problem I've been running into is that FSWatcher instances, if any are created by the unit tests and their associated code, are being duplicated for each test run creating an obvious memory leak, and printing big red warnings in the console. Is there a way to locate them from within the process to close them?
http://nodemanual.org/latest/nodejs_ref_guide/fs.FSWatcher.html
You can call close() on a FSWatcher.