Created
November 16, 2016 13:41
-
-
Save coderofsalvation/5c458825570538525dba4e3969f47daa to your computer and use it in GitHub Desktop.
Revisions
-
coderofsalvation created this gist
Nov 16, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ function spy (fn) { if (!fn) fn = function() {}; function proxy() { var args = Array.prototype.slice.call(arguments); proxy.calls.push(args); proxy.called = true; fn.apply(this, args); } proxy.prototype = fn.prototype; proxy.calls = []; proxy.called = false; return proxy; }