Implement CallTracker.thisFor().
This commit is contained in:
@@ -49,6 +49,19 @@ getJasmineRequireObj().CallTracker = function(j$) {
|
||||
return call ? call.args : [];
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the "this" object that was passed to a specific invocation of this spy.
|
||||
* @name Spy#calls#thisFor
|
||||
* @since 3.7.1
|
||||
* @function
|
||||
* @param {Integer} index The 0-based invocation index.
|
||||
* @return {Object?}
|
||||
*/
|
||||
this.thisFor = function(index) {
|
||||
var call = calls[index];
|
||||
return call ? call.object : undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the raw calls array for this spy.
|
||||
* @name Spy#calls#all
|
||||
|
||||
Reference in New Issue
Block a user