title: Using Istanbul for integration tests against a Node microservice
body: <p>Documentation is pretty sparse on doing coverage with istanbul for integration tests. When I run through my mocha tests, I get <code>No coverage information was collected, exit without writing coverage information</code>.</p>
  
  <p>The first thing I do is instrument all my source code:</p>
  
  <pre><code>✗ istanbul instrument . -o .instrument
  </code></pre>
  
  <p>In my case, this is a REST microservice that is Dockerized which I have written Mocha tests to run against it to validate it once it is deployed. My expectation is istanbul will give me code coverage against the source from that Node service.</p>
  
  <p>The second step I do this command to run node on my instrumented code:</p>
  
  <pre><code>✗ istanbul cover --report none .instrument/server.js
  </code></pre>
  
  <p>After that, I run my tests using the following from the my main src directory as follows (with results):</p>
  
  <pre><code>✗ istanbul cover --report none --dir coverage/unit node_modules/.bin/_mocha -- -R spec ./.instrument/test/** --recursive
  
  
    swagger-tests
      #createPet
        ✓ should add a new pet (15226ms)
      #getPets
        ✓ should exist and return an Array (2378ms)
        ✓ should have at least 1 pet in list (2500ms)
        ✓ should return error if search not name or id
        ✓ should be sorted by ID (3041ms)
        ✓ should be sorted by ID even if no parameter (2715ms)
        ✓ should be only available pets (2647ms)
      #getPetsSortedByName
        ✓ should be sorted by name (85822ms)
      #deletePet
        ✓ should delete a pet (159ms)
  
  
    9 passing (2m)
  
  No coverage information was collected, exit without writing coverage information
  </code></pre>
  
  <p>When I run <code>istanbul report</code>, it obviously has nothing to report on.</p>
  
  <p>What am I missing?</p>
  
  <p>See develop branch of this <a href="https://github.com/occasl/swagger-rest.git" rel="nofollow">project</a> to reproduce issue.</p>