special case for when logging jquery nodes -- print the html

This commit is contained in:
John Bintz 2011-08-11 13:07:48 -04:00
parent dc5b8c026d
commit 6a06d87a4c

View File

@ -28,7 +28,11 @@ module Jasmine
<title>Jasmine Test Runner</title> <title>Jasmine Test Runner</title>
<script type="text/javascript"> <script type="text/javascript">
window.console = { log: function(data) { window.console = { log: function(data) {
if (typeof(jQuery) !== 'undefined' && data instanceof jQuery) {
JHW.log($("<div />").append(data).html());
} else {
JHW.log(JSON.stringify(data)); JHW.log(JSON.stringify(data));
}
}, pp: function(data) { }, pp: function(data) {
JHW.log(jasmine ? jasmine.pp(data) : JSON.stringify(data)); JHW.log(jasmine ? jasmine.pp(data) : JSON.stringify(data));
} }; } };