[Javascript] Unit testing AJAX calls (Was: Probe...)

Scott Reynen scott at randomchaos.com
Wed Jan 7 11:12:14 CST 2009


On [Jan 7], at [ Jan 7] 9:11 , Hassan Schroeder wrote:

> As another long-standing list member, I agree it's unusually quiet,
> but that's also true of many of the other tech lists I'm on.


Holidays, recession, and increasing use of web forums for this type of  
discussion are all likely contributing factors here.  Also, the  
ongoing meta-discussion about the list itself is a good way to drive  
away members.  :)

In the interest of bringing this back on-topic, a JavaScript question:

Does anyone do unit testing on AJAX calls, and if so, how?  I can do  
unit testing on most other JavaScript simply by running the code and  
then testing the result, but with AJAX calls, I'd have to change the  
code itself to call the test framework on response, since the actual  
results of the code are not complete until the AJAX response actually  
comes back.  And I'd like to keep the test framework outside the  
production code.  Suggestions?

Peace,
Scott




More information about the Javascript mailing list