title: husky pre-commit hook for 'test' does not finish
body: <p>Hi i installed <code>husky</code> &amp; <code>lint-stage</code> so as to have pre-commit hooks for <code>lint</code> &amp; <code>tests</code>, for the staged files.</p>
  <p>The pre-commit hook works, when i go to <code>git commit -m 'something'</code>, and the commands are triggered.</p>
  <p><strong>What i have so far in terms of files is:</strong></p>
  <hr />
  <p><code>.husky/pre-commit</code>:</p>
  <pre><code>#!/bin/sh
  . &quot;$(dirname &quot;$0&quot;)/_/husky.sh&quot;
  
  npx lint-staged
  </code></pre>
  <p><code>.package.json</code>:</p>
  <pre><code> &quot;lint-staged&quot;: {
     &quot;*.{ts,tsx}&quot;: &quot;eslint --cache --fix&quot;,
     &quot;*&quot;: &quot;react-scripts test --env=jest-environment-jsdom-fourteen&quot;
    } 
  </code></pre>
  <p>When i <code>git commit ..</code>, (2 files, 1 *.test.ts * and 1 *.ts), it starts the <code>linter</code> &amp; the <code>test</code>, but the test never finishes unless i break it(ctrl+c).</p>
  <ul>
  <li>*<em>the <em>.test.ts file, it has an error in it.</em></em></li>
  </ul>
  <p><a href="https://i.stack.imgur.com/rYqfe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rYqfe.png" alt="enter image description here" /></a></p>
  <p>Only when i break it, i get the errors on the screen:</p>
  <p><a href="https://i.stack.imgur.com/8ocIK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8ocIK.png" alt="enter image description here" /></a></p>
  <p>Also what i notice is that the <code>lint-staged:</code> object, it is changed into package.json, when i <code>git commit..</code> :</p>
  <p><strong>Initially i have it like so:</strong></p>
  <pre><code> &quot;lint-staged&quot;: {
      &quot;*.{ts,tsx}&quot;: &quot;eslint --cache --fix&quot;,
      &quot;*.test.{ts, tsx}&quot;: &quot;react-scripts test --env=jest-environment-jsdom-fourteen&quot;
   }
  </code></pre>
  <p><strong>And it turns to this:</strong></p>
  <pre><code> &quot;lint-staged&quot;: {
     &quot;*.{ts,tsx}&quot;: &quot;eslint --cache --fix&quot;,
     &quot;*&quot;: &quot;react-scripts test --env=jest-environment-jsdom-fourteen&quot;
   }
  </code></pre>
  <p>Any help on the configuration that i miss is welcome please.</p>