I'm having an issue where mocha --watch is only loading changes to the actual *.test.js files in my test folder, but not the supporting files in my src. After searching a bit I'm lead to believe this is due to require caching my src. Is this expected behaviour? And how do I best work around it / the correct way to watch files.
Hmm, with the new change I'm still getting the same issue.
This is the command I'm using
./node_modules/.bin/mocha --watch-files test,src --watch --recursive
'test' and 'src' are directories in the package root.
changes made in 'test' are picked up, changes made in 'src' do trigger a test re-run but the changes are not present
test/main.jsfile that requires
src/index.js. If I modify
src/index.jsthese changes are reflected in the subsequent test run triggered by the watcher. Would you mind opening an issue on Github so we can investigate this further?