Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Can DTP with its Coverage Explorer support Javascript?

amir
amir Posts: 3

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

Tagged:

Comments

  • Marion Levy
    Marion 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: https://marketplace.parasoft.com

  • amir
    amir 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.