Silicon Forks » Forum

It is currently 2019-12-14 2:21 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 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?


Top
  
Reply with quote  
PostPosted: 2011-01-18 2:43 pm 
Offline

Joined: 2008-10-11 6:52 pm
Posts: 120
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.


Top
 Profile  
Reply with quote  
PostPosted: 2011-01-19 9:40 am 
Does jscoverage_report var only work whenn JSUnit is used?


Top
  
Reply with quote  
PostPosted: 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?


Top
  
Reply with quote  
PostPosted: 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.


Top
  
Reply with quote  
PostPosted: 2011-01-19 7:01 pm 
Offline

Joined: 2008-10-11 6:52 pm
Posts: 120
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.


Top
 Profile  
Reply with quote  
PostPosted: 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?


Top
  
Reply with quote  
PostPosted: 2011-01-20 5:19 pm 
Offline

Joined: 2008-10-11 6:52 pm
Posts: 120
The window._$jscoverage variable is where the code coverage data is stored - it is set whenever an instrumented .js file is loaded.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group