Configuring code coverage report for Karma on TeamCity

前端 未结 3 1618
太阳男子
太阳男子 2021-02-05 08:14

We are setting up TeamCity to run our jasmine tests using node and karma.

The tests run fine and results are reported under the \"Tests\" tab in TeamCity.

Howeve

相关标签:
3条回答
  • 2021-02-05 08:44

    Don't know, if the sequence is important, and shouldn't you use [] brackets at preprocessors entries?

    Try the following:

    reporters: ['progress', 'coverage'],
    
    preprocessors: {
     'myProject/Scripts/app/**/*.js': ['coverage']
    },
    
    0 讨论(0)
  • 2021-02-05 08:48

    The easiest way to get TeamCity to recognize your coverage report is to output a build artifact that contains that nice html coverage report.

    Edit the configuration settings for your build and under Artifact Paths add something like:

    coverage/** => coverage.zip
    

    TeamCity will recognize the coverage.zip artifact if it finds the index.html file in the root and will add a Code Coverage tab to each build.

    Source: https://confluence.jetbrains.com/pages/viewpage.action?pageId=74847395#HowTo...-ImportcoverageresultsinTeamCity (Teamcity version 9.x)

    0 讨论(0)
  • 2021-02-05 09:00

    In my case the report was successfully generated into coverage.zip, but the code coverage tab wasn't visible in build report.

    I had to manually add the report tab in Project Settings and provide a full path to the index.html file

    0 讨论(0)
提交回复
热议问题