mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
better error reporting for exceptions
This commit is contained in:
parent
ec6d106d4a
commit
73e3f4c10c
2 changed files with 11 additions and 5 deletions
|
|
@ -28,10 +28,10 @@
|
|||
* See {@link angular.mock} for more info on angular mocks.
|
||||
*/
|
||||
var $logMock = {
|
||||
log: function(){ $logMock.log.logs.push(arguments); },
|
||||
warn: function(){ $logMock.warn.logs.push(arguments); },
|
||||
info: function(){ $logMock.info.logs.push(arguments); },
|
||||
error: function(){ $logMock.error.logs.push(arguments); }
|
||||
log: function(){ $logMock.log.logs.push(concat([], arguments, 0)); },
|
||||
warn: function(){ $logMock.warn.logs.push(concat([], arguments, 0)); },
|
||||
info: function(){ $logMock.info.logs.push(concat([], arguments, 0)); },
|
||||
error: function(){ $logMock.error.logs.push(concat([], arguments, 0)); }
|
||||
};
|
||||
$logMock.log.logs = [];
|
||||
$logMock.warn.logs = [];
|
||||
|
|
|
|||
|
|
@ -103,7 +103,13 @@ afterEach(function() {
|
|||
if ($logMock[logLevel].logs.length) {
|
||||
forEach($logMock[logLevel].logs, function(log) {
|
||||
forEach(log, function deleteStack(logItem) {
|
||||
if (logItem instanceof Error) delete logItem.stack;
|
||||
if (logItem instanceof Error) {
|
||||
dump(logItem.stack);
|
||||
delete logItem.stack;
|
||||
delete logItem.arguments;
|
||||
} else {
|
||||
dump(logItem);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue