title: Getting accurate code coverage statistics with combined JavaScript file + Chutzpah/Blanket.js
body: <p>I have a TypeScript project that uses Visual Studio's "Combine JavaScript output into file" option to create a single <code>.js</code> file containing all my application's code (excluding libraries).  I'm using the <a href="https://visualstudiogallery.msdn.microsoft.com/f8741f04-bae4-4900-81c7-7c9bfb9ed1fe" rel="nofollow noreferrer">Chutzpah Test Adapter</a> to integrate and run Jasmine unit tests.  If I run a code coverage analysis with <em>no</em> tests, the tool reports I have 23% test coverage:</p>
  
  <p><a href="https://i.stack.imgur.com/si4gB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/si4gB.png" alt="Code coverage statistics"></a></p>
  
  <p><strong>What is causing this inflated statistic?</strong></p>
  
  <p>My current theory is that when Chutzpah runs my code (<code>app.js</code>) in order to define all of the classes to be used in the tests, <a href="http://blanketjs.org/" rel="nofollow noreferrer">blanket.js</a> (which is what Chutzpah uses under the hood to get code coverage statistics) sees that these lines are being run and counts them as a "covered line".</p>
  
  <p>Is there a way to only include lines that are hit <em>during</em> a test (as opposed to before the test, for setup purposes) towards the final code coverage statistic?  Or is this inflated number caused by something else?</p>
  
  <p>Here's my <code>chutzpah.json</code>:</p>
  
  <pre><code>{
      "Compile": {
          "Extensions": [ ".ts" ],
          "ExtensionsWithNoOutput": [ ".d.ts" ],
          "Mode": "External"
      },
      "References": [
          { "Path": "initialize.js" },
          { "Path": "./MyApp/lib/jquery-1.11.2.min.js" },
          { "Path": "./MyApp/lib/jquery-ui.min.js" },
          { "Path": "./MyApp/lib/knockout-3.3.0.js" },
  
          /* other references here.... */
  
          { "Path": "./MyApp/app.js" }
      ],
      "Tests": [
          { "Includes": [ "**/*.ts" ], "Excludes": [ "**/*.d.ts" ] }
      ],
      "CodeCoverageIncludes": [ "*app.js*" ],
      "TestFileTimeout": 100000
  }
  </code></pre>