jscoverage_report statement Not working

Questions, problems, suggestions, bug reports, and so on.
Post Reply
nevetha

jscoverage_report statement Not working

Post by nevetha »

In my application, I am reporting the JavaScript Unit test results in JUnit format.

Here I am trying to use jscoverage_report. But it always returns undefined.

Can jscoverage_report be used only with JSunit?

What are the other options in which i can generate the coverage programatically and store it?
Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: jscoverage_report statement Not working

Post by Ed »

Have you tried the example in the doc/example-jsunit directory? The best thing to do is to get that working, and then adapt that to your test suite and test framework.
Guest

Re: jscoverage_report statement Not working

Post by Guest »

Does jscoverage_report var only work whenn JSUnit is used?
Guest

Re: jscoverage_report statement Not working

Post by Guest »

The example-jsunit file has test.html and script.js files which are both of size 1KB.
But when i look in the archive directly there are of size 483 and 72. But after extracting they become 1KB. Is there any issues on this?
Guest

Re: jscoverage_report statement Not working

Post by Guest »

Pls ignore my previous post.. I tried the example-jsunit. But my application doesnot use JsUnit test framework. I am using a customised framework. Now JSCoverage works well, but when i need to store the results programatically I have the trouble.
The jscoverage_report var is always undefined.
Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: jscoverage_report statement Not working

Post by Ed »

The jscoverage_report function does not require JsUnit, it's just used in the example. Are you able to get the example working? If you can get the example working it will probably not be difficult to adapt it to your own custom test framework.
Guest

Re: jscoverage_report statement Not working

Post by Guest »

I accessed the jscoverage using window._$jscoverage.

Is this correct? And when does this get set or when does this get undefined?
Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: jscoverage_report statement Not working

Post by Ed »

The window._$jscoverage variable is where the code coverage data is stored - it is set whenever an instrumented .js file is loaded.
Post Reply