Skip to content

Commit 2629f7f

Browse files
committed
test(parse): Test for the parsing not invoking twice to get self
New test to not call twice a function to get self
1 parent 2d5297e commit 2629f7f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/ng/parseSpec.js

+11
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,17 @@ describe('parser', function() {
483483
});
484484

485485

486+
it('should call the function once when it is part of the context', function() {
487+
var count = 0;
488+
scope.fn = function() {
489+
count++;
490+
};
491+
scope.fn.anotherFn = function() { return ''; };
492+
expect(scope.$eval('fn().anotherFn()')).toBe('');
493+
expect(count).toBe(1);
494+
});
495+
496+
486497
describe('promises', function() {
487498
var deferred, promise, q;
488499

0 commit comments

Comments
 (0)