mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-14 01:33:11 +00:00
improved dump function to atomatically render HTML
This commit is contained in:
parent
72e554ffeb
commit
459a01e582
1 changed files with 14 additions and 3 deletions
|
|
@ -9,7 +9,18 @@ _jQuery.event.special.change = undefined;
|
||||||
|
|
||||||
if (window.jstestdriver) {
|
if (window.jstestdriver) {
|
||||||
jstd = 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(){
|
beforeEach(function(){
|
||||||
|
|
@ -60,9 +71,9 @@ function clearJqCache(){
|
||||||
count ++;
|
count ++;
|
||||||
delete jqCache[key];
|
delete jqCache[key];
|
||||||
forEach(value, function(value, key){
|
forEach(value, function(value, key){
|
||||||
if (value.$element)
|
if (value.$element)
|
||||||
dump(key, sortedHtml(value.$element));
|
dump(key, sortedHtml(value.$element));
|
||||||
else
|
else
|
||||||
dump(key, toJson(value));
|
dump(key, toJson(value));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue