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?
jscoverage_report statement Not working
-
- Posts: 120
- Joined: 2008-10-11 6:52 pm
Re: jscoverage_report statement Not working
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.
Re: jscoverage_report statement Not working
Does jscoverage_report var only work whenn JSUnit is used?
Re: jscoverage_report statement Not working
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?
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?
Re: jscoverage_report statement Not working
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.
The jscoverage_report var is always undefined.
-
- Posts: 120
- Joined: 2008-10-11 6:52 pm
Re: jscoverage_report statement Not working
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.
Re: jscoverage_report statement Not working
I accessed the jscoverage using window._$jscoverage.
Is this correct? And when does this get set or when does this get undefined?
Is this correct? And when does this get set or when does this get undefined?
-
- Posts: 120
- Joined: 2008-10-11 6:52 pm
Re: jscoverage_report statement Not working
The window._$jscoverage variable is where the code coverage data is stored - it is set whenever an instrumented .js file is loaded.