title: Git pre-commit hook to run `npm test` on CMD (Windows)
body: <p>I've created a <code>.bat</code> (<code>pre-commit-tests.bat</code>) file with the content:</p>
  <pre><code>cd ../../BUILD
  npm test
  </code></pre>
  <p>in the project's <code>.git\hooks</code> directory.</p>
  <p>when I do commit, it seems to show the CMD window for a brief second and close it, I don't know why my tests are not running or how to keep the CMD window open even after it finishes, so at least maybe read any output (if there's a problem).</p>
  <p>If I manually run <code>npm test</code> (which is a task configured in my <code>package.json</code> file, then it does work and the tests are running (takes about 4 seconds to run). <br>
  <em>(complex mocha tests running on slimerjs)</em>.</p>
  <h3>I'm using TortoiseGit to configure Git hooks like so:</h3>
  <p><a href="https://i.stack.imgur.com/wLVxD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wLVxD.png" alt="enter image description here" /></a></p>
  <p>Why doesn't it run the command using the hook correctly?<br>
  Did I write the hook file wrong?</p>