Unit testing with network requests

Unit testing with network requests

Hi all,<div>
</div><div>I'm turning to you once more for a problem I think you can help me with.</div><div>
</div><div>So far, for my jsonp plugin (for those who don't know of it: <a href="http://code.google.com/p/jquery-jsonp/">http://code.google.com/p/jquery-jsonp/</a>), I just made a simple test page using the YouTube data API. I have the plugin working in production so I know it's solid but, unfortunately, the site I use it on doesn't cover the whole feature set.</div>
<div>
</div><div>So, I'd like to have unit tests for $.jsonp() and was curious as to how you would construct such tests. The main issue I have is that it involves network traffic. How were the $.ajax unit tests constructed? Is there some sort of server-side code to test timeouts or programmatic aborts?</div>
<div>
</div><div>Any hint is welcome :)</div><div>
</div><div>-- Julian</div>