Jasmine htmlReporter write to screen?

201 views
Skip to first unread message

Claus Fjellø-Jensen

unread,
Aug 15, 2013, 4:34:06 PM8/15/13
to jasmi...@googlegroups.com

Is there some simple way add (write) your own output to the Jasmine result screen so that it merges nicely with the rest of the Jasmine output - maybe some htmlReporter function to do this?


I have writing some small performance test that executes from a Jasmine test javascript:

it("moveNodes: performance move 10000 entries:", function () {
    startTime = new Date().getTime();
    myObject.moveNodes(4000 , 5000);
    endTime = new Date().getTime();
    var testRes = (endTime - startTime);
    
     $(document.body).append('<div id="perfRes" ></div>');
    $("#perfRes").append('<div  class="myJasmine" >moveNodest:  4000 -> 5000: ' + testRes + ' milliSec</div>');
}

It all works fine and prints out nicely with this bit of CSS styling:

.myJasmine {
  color: #5e7d00; 
  font-size: 11px;
  font-family: Monaco, "Lucida Console", monospace; 
  line-height: 14px; 
  text-indent:33px;
}

However, it only work when put as the very last test item, otherwise it gets mixed up with the other Jasmine output.

Any suggestions or hacks?

Regards,
Claus

Davis W. Frank

unread,
Aug 19, 2013, 10:10:48 AM8/19/13
to jasmi...@googlegroups.com
Assuming you're using 2.0rc2, you could make a new Reporter object of your own definition, register it in boot.js, and then write to the DOM when jasmineDone is called.

--dwf 


--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jasmine-js+...@googlegroups.com.
To post to this group, send email to jasmi...@googlegroups.com.
Visit this group at http://groups.google.com/group/jasmine-js.
For more options, visit https://groups.google.com/groups/opt_out.



--
thx,
--dwf

Rachid Zianne

unread,
Aug 3, 2015, 10:50:30 AM8/3/15
to Jasmine
Hi!
can you give us example @dwf ?
Thanks in advance
Richard

Gregg Van Hove

unread,
Aug 3, 2015, 12:12:29 PM8/3/15
to jasmi...@googlegroups.com
Take a look at the docs for writing a custom reporter here: http://jasmine.github.io/edge/custom_reporter.html

--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jasmine-js+...@googlegroups.com.
To post to this group, send email to jasmi...@googlegroups.com.
Visit this group at http://groups.google.com/group/jasmine-js.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages