문제

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