Can DTP with its Coverage Explorer support Javascript?

amiramir Posts: 3

We are working on a new application that is based on Javascript on nodejs for server and Angular for the client.



  • Marion LevyMarion Levy Posts: 9 admin

    If you are using Karma as your unit test runner and Istanbul for generating the coverage, then Istanbul can generate a Cobertura report.

    Given this report, you can report the results to DTP using the cobertura extension found on marketplace here:

  • amiramir Posts: 3

    Thanks Marion for your prompt response, besides unit tests, we also have integration tests and UI based test (using Selenium), where Karma and Istanbul are not relevant, so is there way to address them?

  • Hi amir,

    Coverage can be captured for both the back-end (NodeJS) and front-end (browser) using Istanbul, then imported into DTP using the Coburtura Extension.

    For the back-end starting the NodeJS application using “istanbul cover” is enough to capture coverage information for both unit tests and functional tests.

    For the front-end Karma can be used to generate unit test coverage, but functional test coverage for the front-end requires a bit of setup and some code changes. There is a great article on Medium (Front-end JavaScript test coverage with Istanbul + Selenium) that explains how to collect front-end coverage using Istanbul and Selenium. If the application can be configured as described in the article (or in a similar fashion) then a Coburtura XML report can be generated and imported into DTP using the Coburtura Extension.

Sign In or Register to comment.