You can measure the code coverage for your test inside the Control.qunit.html page either via HTML or JavaScript code using Blanket.js.
<script type="text/javascript" src="../../../../../resources/sap/ui/qunit/qunit-coverage.js"></script>
<script type="text/javascript" src="../../../../../resources/sap/ui/qunit/qunit-coverage.js"
data-sap-ui-cover-only="sap/ui/core/Popup.js"
></script>
<script type="text/javascript" src="../../../../../resources/sap/ui/qunit/qunit-coverage.js"
data-sap-ui-cover-only="[sap/ui/core/Popup.js, sap/ui/core/EventProvider]"
></script>
<script type="text/javascript" src="../../../../../resources/sap/ui/qunit/qunit-coverage.js"
data-sap-ui-cover-only="sap/ui/core/"
></script>
<script type="text/javascript" src="../../../../../resources/sap/ui/qunit/qunit-coverage.js"
data-sap-ui-cover-never="sap/m/"
></script>
jQuery.sap.require("sap.ui.qunit.qunit-coverage");
if (window.blanket) {
blanket.options("sap-ui-cover-only", "sap/ui/core/Popup.js");
}
if (window.blanket) {
blanket.options("sap-ui-cover-only", "[sap/ui/core/Popup.js, sap/ui/core/EventProvide]");
}
if (window.blanket) {
blanket.options("sap-ui-cover-only", "sap/ui/core/");
}
if (window.blanket) {
blanket.options("sap-ui-cover-never", "sap/ui/example/thirdparty/");
}
To view the results of the measurement, select the Enable coverage checkbox on the test page. This will trigger a new test run.
In this example the coverage is limited to one specific file - the only one that is important for this test.