Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d1cdd4d

Browse files
committed
chore(dump): fix our karma.dump bridge
previously it didn't work for dumping multiple objects
1 parent af73135 commit d1cdd4d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/ng/rootScope.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ function $RootScopeProvider(){
577577
*
578578
* @description
579579
* Broadcasted when a scope and its children are being destroyed.
580-
*
580+
*
581581
* Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
582582
* clean up DOM bindings before an element is removed from the DOM.
583583
*/
@@ -601,7 +601,7 @@ function $RootScopeProvider(){
601601
* Just before a scope is destroyed a `$destroy` event is broadcasted on this scope.
602602
* Application code can register a `$destroy` event handler that will give it chance to
603603
* perform any necessary cleanup.
604-
*
604+
*
605605
* Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
606606
* clean up DOM bindings before an element is removed from the DOM.
607607
*/

src/ngMock/angular-mocks.js

+1
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,7 @@ angular.mock.dump = function(object) {
787787
} else if (object instanceof Error) {
788788
out = object.stack || ('' + object.name + ': ' + object.message);
789789
} else {
790+
// TODO(i): this prevents methods to be logged, we should have a better way to serialize objects
790791
out = angular.toJson(object, true);
791792
}
792793
} else {

test/testabilityPatch.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -291,5 +291,7 @@ function trace(name) {
291291

292292
var karmaDump = dump;
293293
window.dump = function () {
294-
karmaDump(angular.mock.dump.apply(undefined, arguments));
294+
karmaDump.apply(undefined, map(arguments, function(arg) {
295+
return angular.mock.dump(arg);
296+
}));
295297
};

0 commit comments

Comments
 (0)