How to fake jquery.ajax() response?

前端 未结 6 499
孤独总比滥情好
孤独总比滥情好 2020-12-07 20:56

I am writing some QUnit tests for a JavaScript that makes AJAX calls.

For isolation I overwrite $.ajax to write the parameter array of an AJAX call to a

6条回答
  •  無奈伤痛
    2020-12-07 21:24

    I think the link below should help. as for a parameter I am not so sure but it could be .

    $.fn.ajax.success =  function (){
      ///the rest goest here
    }
    

    Override jQuery .val() function?

提交回复
热议问题