Domanda

I'm unable to get blanket.js test coverage to work with qunit, literally nothing happens despite many attempts at re-configuring and trying to invoke debugging.

These are the documented instructions I tried to follow - https://github.com/alex-seville/blanket/blob/master/docs/getting_started_browser.md#getting-started-guide-browser-version

Here is my test runner

<!doctype html>
<html>
    <head>
    <meta charset='UTF-8' />
    <meta http-equiv='content-type' content='text/html; charset=utf-8' />

    <title>bootstrap-treeview.js Tests</title>

    <link rel='stylesheet' href='./lib/qunit-1.12.0.css'>

    <script src='./lib/jquery.js'></script>
    <script src='./lib/qunit-1.12.0.js'></script>
    <script data-cover-flags="debug" src="./lib/blanket.min.js"></script>
    <script data-cover src='./lib/bootstrap-treeview.min.js'></script>
    <script src='./tests.js'></script>
</head>
<body>
    <div id="qunit"></div> 
    <div id='qunit-fixture'>
        <div id="treeview"></div>
    </div>
</body>

I must be missing something fundamental, no console errors, no nothing. My reports run fine, qunit reports display as usual but nothing is being added with blanket. No additional coverage report is generated, no debugging despite adding the data-cover-flags="debug".

Any help, direction, much appreciated?

È stato utile?

Soluzione

you need to add the data-cover flag to your files which should be covered.

For example my testrunner looks almost the same as yours:

...
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="http://code.jquery.com/qunit/qunit-1.12.0.js"></script>
<script src="lib/jquery.js"></script>
<script src="lib/blanket.min.js"></script>

<script src="../../impl/fileSupport.js" data-cover></script>


<script src="myQunitTests.js"></script>

</body>
...

After you this, you are able to enable the data coverage in your qunit testrunner (next to qunit option no try-catch) as seen on the following image:

enable_coverage

Hope this helps.

BR, mybecks

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top