Created
May 19, 2015 16:03
-
-
Save balaclark/aa8e03ae6057aded072d to your computer and use it in GitHub Desktop.
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 characters
function spy() { | |
var called = false | |
, args = null | |
function spyFn() { | |
called = true | |
args = Array.prototype.slice.call(arguments) | |
} | |
spyFn.calledWith = function calledWith() { | |
return args | |
} | |
spyFn.reset = function reset() { | |
called = false | |
args = null | |
} | |
return spyFn | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment