title: Catch npm ERR! when running npm test from shell script
body: <p>I have a shell script that recursively searches for package.json from a base directory and runs npm test like so.</p>
  
  <pre><code>find "$parent_dir" -name package.json -maxdepth 2 -execdir npm test \;
  </code></pre>
  
  <p>I want to intercept tests failure in the form of:</p>
  
  <pre><code>npm ERR! Test failed.  See above for more details.
  npm ERR! not ok code 0
  </code></pre>
  
  <p>So I can have the shell script exit with an error status.</p>
  
  <p>Any help is appreciated.</p>