質問

I am using Chutzpah for measuring JavaScript code coverage, but it is including js unit tests also in the report.

Is there anyway to exclude folders?

I've tried the below json setting, but it works if provided filename, but not working for folder.

    { 
      "CodeCoverageExcludes": ["*knockout-2.1.0.js", "*jquery-1.8.2.js","*\\Tests\\Cms.UnitTests\*"] 
    }
役に立ちましたか?

解決

You did not escape the last backlash. It should be:

{ 
      "CodeCoverageExcludes": ["*knockout-2.1.0.js", "*jquery-1.8.2.js","*\\Tests\\Cms.UnitTests\\*"] 
}

他のヒント

I know that this is an old question but this is how I excluded the actual test files themselves from the Code Coverage results:

{
    "CodeCoverageExcludes": ["*-test.js"]
}

This is of course assuming that all of your test files end in -test.js, but if you're just starting off writing your tests this shouldn't be a problem.

I verified that when running this I still get accurate results for my actual code files that are being tested.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top