Questions tagged [code-coverage]

"Testability score," also known as "code coverage," calculates the portion of the application's source code that has been tested, typically through a series of tests, most commonly unit testing.

Angular 2 code test coverage

Looking to calculate the code coverage of my Angular 2 code. Wondering if there are any plugins available for VS Code or WebStorm that can assist with this. My unit testing is done using Jasmine and Karma. ...

Getting the percentage of code coverage in Selenium tests in relation to the web application code

I need to track the code coverage of my selenium tests in relation to the source code of the server (web application source code) that they cover. For instance, I want the tests for the login feature to measure how much of the web application's code is co ...

Test results indicate successful completion of tests for VueJS component files, however code coverage does not reflect this for those

Currently, I am facing an issue while trying to obtain code coverage results for my VueJS frontend application. It seems that when I create a component and write a snapshot test for it, the file is being ignored by WebStorm. After some investigation, I di ...

Combining Mocha, BlanketJS, and RequireJS has resulted in the error message "No method 'reporter'."

While using Mocha with RequireJS, my tests are running smoothly. However, I encountered an issue when trying to incorporate blanket code coverage. The error Uncaught TypeError: Object #<HTMLDivElement> has no method 'reporter' keeps popping up. Belo ...

Authorization error preventing nose test coverage

I just started using nosetests today and everything was going smoothly until I attempted the following command: nosetests --with-coverage --cover-html --cover-html-dir=/tmp/cache. Suddenly, a permission denied error popped up, leaving me puzzled as to why ...

Concerns regarding code coverage when testing asynchronous functions using nockjs and jest

In my latest project, I've created a basic unit test for making API calls using NockJS and Jest within a React application. Here's a snippet of the code: AjaxService.js export const AjaxService = { post: (url, data, headers) => { return ax ...

PHP code coverage collection remotely

For our current project, we have set up a system where we run PHPUnit tests using Selenium and Curl on a separate development server. Server B hosts an Apache server which serves the website. To begin the testing process, server A synchronizes the project ...

What is preventing Sonar from interpreting the format of the coverage results generated by django-nose?

Encountering an exception when attempting to send a Python project using sonar-scanner: Caused by: java.lang.IllegalStateException: Unknown report version: 4.4.2. This parser only handles version 1.". Project was running normally before introducing the ...

Enhancing code branch coverage using Istanbul

The code snippet provided has a branch coverage of only 50% (refer to the coverage report below). I am unsure how to enhance this as there are no if statements present. I suspect that Istanbul must utilize some form of measurement that I have yet to grasp ...

What steps should I follow to obtain code coverage data in my Aurelia application with the help of karma?

After creating my Aurelia app using the Aurelia CLI (au new), I wanted to set up code coverage, preferably with karma-coverage, but was open to other options as well. First, I ran npm install karma-coverage --save-dev and then copied the test.js task over ...

Can getters and setters be excluded from code coverage reports in Angular projects?

Looking to clean up my coverage reports for the front end portion of an angular project by removing trivial code like getters and setters. I generate my reports using npm run test-sonar -- --coverage, but everything is included in the report when I view ...