diff options
| author | Igor Minar | 2013-08-07 11:20:51 -0700 |
|---|---|---|
| committer | Igor Minar | 2013-08-07 11:21:34 -0700 |
| commit | d1cdd4d026968993db9d0130390bb5138b942224 (patch) | |
| tree | eb0a4ce921416b1244c1c9b5b8d961251f621146 | |
| parent | af731354b0b600f87f15e1573e64a7f7acc70f3d (diff) | |
| download | angular.js-d1cdd4d026968993db9d0130390bb5138b942224.tar.bz2 | |
chore(dump): fix our karma.dump bridge
previously it didn't work for dumping multiple objects
| -rw-r--r-- | src/ng/rootScope.js | 4 | ||||
| -rw-r--r-- | src/ngMock/angular-mocks.js | 1 | ||||
| -rw-r--r-- | test/testabilityPatch.js | 4 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/ng/rootScope.js b/src/ng/rootScope.js index 2e76d6ee..d94a621d 100644 --- a/src/ng/rootScope.js +++ b/src/ng/rootScope.js @@ -577,7 +577,7 @@ function $RootScopeProvider(){ * * @description * Broadcasted when a scope and its children are being destroyed. - * + * * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to * clean up DOM bindings before an element is removed from the DOM. */ @@ -601,7 +601,7 @@ function $RootScopeProvider(){ * Just before a scope is destroyed a `$destroy` event is broadcasted on this scope. * Application code can register a `$destroy` event handler that will give it chance to * perform any necessary cleanup. - * + * * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to * clean up DOM bindings before an element is removed from the DOM. */ diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js index 36bf982f..ff2d79d4 100644 --- a/src/ngMock/angular-mocks.js +++ b/src/ngMock/angular-mocks.js @@ -787,6 +787,7 @@ angular.mock.dump = function(object) { } else if (object instanceof Error) { out = object.stack || ('' + object.name + ': ' + object.message); } else { + // TODO(i): this prevents methods to be logged, we should have a better way to serialize objects out = angular.toJson(object, true); } } else { diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index 32dd75ea..7b4fe0ec 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -291,5 +291,7 @@ function trace(name) { var karmaDump = dump; window.dump = function () { - karmaDump(angular.mock.dump.apply(undefined, arguments)); + karmaDump.apply(undefined, map(arguments, function(arg) { + return angular.mock.dump(arg); + })); }; |
