jscoverage_report statement Not working

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

jscoverage_report statement Not working

Post by nevetha » 2011-01-18 12:48 pm

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 » 2011-01-18 2:43 pm

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 » 2011-01-19 9:40 am

Does jscoverage_report var only work whenn JSUnit is used?

Guest

Re: jscoverage_report statement Not working

Post by Guest » 2011-01-19 10:37 am

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 » 2011-01-19 2:12 pm

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 » 2011-01-19 7:01 pm

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 » 2011-01-20 12:28 pm

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 » 2011-01-20 5:19 pm

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

Post Reply