title: No coverage nyc mocha
body: <p>I am just unable to figure out why test coverage is 0 even though test case is passing. I have a script in package.json: </p>
  
  <pre><code>"nyctest": "node --max_old_space_size=4096 node_modules/nyc/bin/nyc.js --reporter=text mocha"
  </code></pre>
  
  <p>When I run <code>npm run nyctest</code></p>
  
  <p>My test pass, but coverage is 0 percent. </p>
  
  <p><a href="https://i.stack.imgur.com/gFgDP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gFgDP.png" alt="enter image description here"></a></p>
  
  <p>Following is the test and the file is it testing:</p>
  
  <p><strong>test.js</strong></p>
  
  <pre><code>var chai = require('chai');
  var sinon = require('sinon');
  var sinonChai = require('sinon-chai');
  chai.should();
  chai.use(sinonChai);
  var application = require('../../../src/main/resources/static/js/components/app.js');
  
  describe('sample return testing', function(){
      it('should return true', function(){
          application.sample.returnValue().should.equal(true);
      })
  });
  </code></pre>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>const sample = {
      returnValue: function () {
          return true;
      }
  };
  
  module.exports = {sample};
  </code></pre>
  
  <p>Appreciate any help. </p>