Verify unit tests are actually being ran, not just skipped over because it's poorly written
<p>We're using sinon and mocha to do our unit tests.  I've come up with the problem several times where I write some tests (Maybe in a promise, or a callback, or a stub) and the tests in these do not ever get hit, thus they aren't actually testing anything.  </p>

<p>I can't imagine being the only one who has done this, so was wondering what people do to verify the test they wrote is actually being ran.</p>

<p>As an example:</p>

<pre><code>// sStuff...

let myStub = sinon.stub(className, "classMethod", (result) =&gt; {
    // THIS will never be ran.
    expect(result).to.be.equal(5);
});

expect(myStub.callCount).to.be.equal(0);

// Stuff...
</code></pre>

<p>The test won't complain it wasn't ran, because we have the callCount check, but in reality, we're never calling something on className to have the classMethod function to be called and testing the result against 5.</p>

<p>Any common solutions?  I couldn't think of search terms for this.</p>

<p>Thanks!</p>