Track return values of spy functions
This commit is contained in:
@@ -56,11 +56,16 @@ getJasmineRequireObj().base = function(j$) {
|
||||
}),
|
||||
callTracker = new j$.CallTracker(),
|
||||
spy = function() {
|
||||
callTracker.track({
|
||||
var callData = {
|
||||
object: this,
|
||||
args: Array.prototype.slice.apply(arguments)
|
||||
});
|
||||
return spyStrategy.exec.apply(this, arguments);
|
||||
};
|
||||
|
||||
callTracker.track(callData);
|
||||
var returnValue = spyStrategy.exec.apply(this, arguments);
|
||||
callData.returnValue = returnValue;
|
||||
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
for (var prop in originalFn) {
|
||||
|
||||
Reference in New Issue
Block a user