visionmedia/mocha — Issue #139: Watch what the tests require?
Author: orlin
Created: 2011-12-11 15:27:26+00:00
State: open

A common mantra for tdd / bdd is: "write some tests that fail, make them pass", aka test-first. The current implementation of `--watch` just sits idle in this case. It's often hard to get the tests wrong, what's being tested is more in need of watching than the code that's testing it. I think node reloaders have already solved catching this. I haven't checked how, but if I had to guess: it's by checking what's `require`d... For simplicity sake (and to avoid circular requires) just one level deep is all that's needed in most test cases. If what's tested changes, the tests run again.