Вопрос

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