all files / core/spying/ spy-on.js

27.27% Statements 3/11
100% Branches 0/0
0% Functions 0/2
27.27% Lines 3/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16                         
"use strict";
var spy_1 = require("./spy");
function SpyOn(target, functionName) {
    var spy = new spy_1.Spy(target[functionName], target);
    target[functionName] = function () {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            args[_i - 0] = arguments[_i];
        }
        return spy.call(args);
    };
    target[functionName].calls = spy.calls;
    return spy;
}
exports.SpyOn = SpyOn;
//# sourceMappingURL=spy-on.js.map