Javascript Code Coverage

Conor's Avatar

Conor

25 Nov, 2014 01:15 PM

Hi
We're using Karma to generate code coverage reports for a node js project.
When we run our test scripts by calling npm test a coverage report is generated. The generated reports can be in different formats for example html, lcov or cobertura. Ideally we would like to print the results of this to Appveyor as well as integrate with https://coveralls.io/ to get coverage statistics and history. Do you know if anything like this is possible?
Thanks

  1. Support Staff 1 Posted by Feodor Fitsner on 25 Nov, 2014 07:16 PM

    Feodor Fitsner's Avatar

    Hi Conor,

    You can import test results using AppVeyor Build Worker API.

    Take a look at how it was done for Jasmine: http://help.appveyor.com/discussions/kb/7-integrating-chutzpah-into...

  2. 2 Posted by Conor on 04 Dec, 2014 05:24 PM

    Conor's Avatar

    Nice, thanks Feodor.

    I have the test results uploading in a custom build script now.

    As for the code coverage results, which are in a separate file and format, should I be able to upload these to appveyor as well via the Build Worker API?

    I'm able to generate the code coverage reports in quite a few different formats. Attached is one report example in cobertura format

    Possible formats are:

    html (default)
    lcov (lcov and html)
    lcovonly
    text
    text-summary
    cobertura (xml format supported by Jenkins)
    teamcity (code coverage System Messages for TeamCity)

  3. Support Staff 3 Posted by Feodor Fitsner on 05 Dec, 2014 02:51 AM

    Feodor Fitsner's Avatar

    Well, you can upload everything unless you parse it and call "add test" API command.

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:50 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac