Date on JSCoverage report

Questions, problems, suggestions, bug reports, and so on.
Post Reply
lowerEastSide
Posts: 6
Joined: 2009-04-06 3:19 pm

Date on JSCoverage report

Post by lowerEastSide » 2009-04-20 1:54 pm

I am using jscoverage-server.exe and storing report using jscoverage_report(); at the end of jsunit test suite. I want to know if its possible for the report page to have date. The date should be the one on which Jsunit test suite was run.

Thanks

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: Date on JSCoverage report

Post by Ed » 2009-04-21 6:01 am

There is no way to change the name of the page, but you can change the name of the report directory, in two ways:
  • Use the --report-dir option to jscoverage-server.exe; e.g.,

    Code: Select all

    jscoverage-server.exe --report-dir=jscoverage-report-2009-4-21
  • Pass the name of the directory as a parameter to the jscoverage_report() function; e.g.,

    Code: Select all

    var date = new Date();
    var y = date.getYear() + 1900;
    var m = date.getMonth() + 1;
    var d = date.getDate();
    jscoverage_report('jscoverage-report-' + y + '-' + m + '-' + d);
    Note that in this case you will get an additional directory level in your directory structure.

lowerEastSide
Posts: 6
Joined: 2009-04-06 3:19 pm

Re: Date on JSCoverage report

Post by lowerEastSide » 2009-04-21 5:08 pm

Hello Ed,

thank you. What abt doing search and replace on jscoverage.html from "<h1>JSCoverage</h1>" to "<h1>JSCoverage ${DATE}</h1>" ?

Regards,
les

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: Date on JSCoverage report

Post by Ed » 2009-04-21 5:43 pm

Certainly, once the report is generated you can modify the report HTML any way you like. (But there is no functionality built into jscoverage to do this.)

Post Reply