title: JEST: Is there a solution to run tests only for changed/impacted files?
body: <p>There are few solutions given by Jest in that direction. I have tried out most of the solutions like <code>--findRelatedTests</code>, <code>--onlyChanged</code>, <code>--changedSince</code>. But there are few shortcomings in every solutions. I thought <code>--changedSince</code> is the best match for me.</p>
  <pre><code>jest --changedSince=origin/master --coverage
  </code></pre>
  <p>It mostly covers the basic scenarios like running test files corresponding to the changed source files. But it does not handle few scenarios like if a source-file(say <code>a.js</code>) is <strong>deleted</strong> and same(<code>a.js</code>) is being used(imported) in another file(say <code>b.js</code>), it does not run <em>tests</em> for any of the files(<code>a.js</code> or <code>b.js</code>). It does not seem to run tests for parent files where it was imported.</p>
  <p>Is there a clean solution which can handle all the scenarios like file rename/deletion, dynamic imports, running tests for the parent modules where it was imported or any other impact that may happen when you change a source file?</p>