Page 1 of 1

Date on JSCoverage report

Posted: 2009-04-20 1:54 pm
by lowerEastSide
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

Re: Date on JSCoverage report

Posted: 2009-04-21 6:01 am
by Ed
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.

Re: Date on JSCoverage report

Posted: 2009-04-21 5:08 pm
by lowerEastSide
Hello Ed,

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

Regards,
les

Re: Date on JSCoverage report

Posted: 2009-04-21 5:43 pm
by Ed
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.)