CallTracker.thisFor(): add test for undefined context object.

This commit is contained in:
Alexander J. Vincent
2021-04-13 18:35:04 -07:00
parent e303de52ed
commit fa72544974

View File

@@ -37,9 +37,11 @@ describe('CallTracker', function() {
this1 = {};
callTracker.track({ object: this0, args: [] });
callTracker.track({ object: this1, args: [] });
callTracker.track({ args: [] });
expect(callTracker.thisFor(0)).toBe(this0);
expect(callTracker.thisFor(1)).toBe(this1);
expect(callTracker.thisFor(2)).toBe(undefined);
});
it('returns any empty array when there was no call', function() {