Mocha fails to reload watched files #4016
Labels
area: node.js
command-line-or-Node.js-specific
status: accepting prs
Mocha can use your help with this one!
type: bug
a defect, confirmed by a maintainer
Under certain circumstances Mocha fails to reload source files in watch mode. Specifically, if a file is watched and modified but only required by a file that is not watched then the modified file is not reloaded and the change is not visible to the test suite.
This issue can be addressed by adding the unwatched files to
--watch-files
Steps to Reproduce
Create the following three files
Now run
The test suite passes.
Now modify
lib-a/index.js
so that the exported value isfalse
. This will retrigger the tests but they will still succeed.If
lib-b
is add to the--watch-files
list then the modification results in a test failure.The text was updated successfully, but these errors were encountered: