"use strict";
var _spying_1 = require("../_spying");
function SpyOn(target, functionName) {
var spy = new _spying_1.RestorableSpy(target, functionName);
target[functionName] = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
return spy.call(args);
};
// expose spy's calls on function
target[functionName].calls = spy.calls;
// expose spy's restore function
target[functionName].restore = spy.restore.bind(spy);
return spy;
}
exports.SpyOn = SpyOn;
//# sourceMappingURL=spy-on.js.map |