mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-06-19 17:53:27 +08:00
better error reporting for exceptions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user