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