Skip to content

Instantly share code, notes, and snippets.

@stevehebert
Created May 21, 2012 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevehebert/2763916 to your computer and use it in GitHub Desktop.
Save stevehebert/2763916 to your computer and use it in GitHub Desktop.
ajax mocking
class JQueryAjaxStub
constructor: (timeOut, functionData) ->
@originalAjax = jQuery.ajax
jQuery.ajax = (data) =>
setTimeout( ->
(data.success functionData(data.data))
, timeOut)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment