Ajax means your code performs requests to the server, usually using the XMLHttpRequest object. If your test of that code involves a server, you may end up actually testing more server code then JavaScript. If you are fine with that, you can use a testing framework like QUnit(part of the jQuery project, but doesn't require jQuery) or YUI Test that supports asynchronous tests, which are necessary here.
Otherwise you should replace the actual ajax request with a mock request that just returns some testdata, without ever performing an actual request. There are various solutions for that, but I need more context for any specific recommendation. Though, if you are using jQuery's ajax module, you can leverage the xhr-option for replacing the XMLHttpRequest with a mock object.