diff options
| author | Misko Hevery | 2011-01-18 14:57:25 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-01-18 15:02:51 -0800 |
| commit | 459a01e582de91d95375d1438e49a35df6f64293 (patch) | |
| tree | 755070fdb2c12d6e0be461a830cae2fe219ea912 /test/testabilityPatch.js | |
| parent | 72e554ffebc7a1d4aa83e699f8f776e8089ffc22 (diff) | |
| download | angular.js-459a01e582de91d95375d1438e49a35df6f64293.tar.bz2 | |
improved dump function to atomatically render HTML
Diffstat (limited to 'test/testabilityPatch.js')
| -rw-r--r-- | test/testabilityPatch.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index 224a8915..7029b213 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -9,7 +9,18 @@ _jQuery.event.special.change = undefined; if (window.jstestdriver) { jstd = jstestdriver; - dump = bind(jstd.console, jstd.console.log); + window.dump = function(){ + var args = []; + forEach(arguments, function(arg){ + if (isElement(arg)) { + arg = sortedHtml(arg); + } else if (isObject(arg)) { + org = toJson(arg, true); + } + args.push(arg); + }); + jstd.console.log.apply(jstd.console, args); + }; } beforeEach(function(){ @@ -60,9 +71,9 @@ function clearJqCache(){ count ++; delete jqCache[key]; forEach(value, function(value, key){ - if (value.$element) + if (value.$element) dump(key, sortedHtml(value.$element)); - else + else dump(key, toJson(value)); }); }); |
