ajax - Problems with mocking jsonp requests using mockjax in qunit -


I want to use mockjacks with kinetracks, but it can not be found to work. Here's a simple test I tried:

  asyncTest ('response returns jsonp', function () {$ .mockjax ({url: 'http: //search.twitter. Com / search Json * ', contentType:' text / json ', proxy:' mocks / twitter.json '}); window.abcdef123456 = function () {start (); OK (true,' execution of Jason callback ') ;}; $ .ajax ({url: 'http://search.twitter.com/search.json?q=Javascript&callback=?', JsonpCallback: 'abcdef123456', datatype: 'jsonp', error: function ( ) {}, Complete: function () {}}); $ .mockjaxClear ();});   

Moxx works like a magic without code but really does not work with it ... am I talking wrong? Tried to use Sinon.js, but there are some problems with asynchronous testing, so I wanted to switch to the mockjax. But my code just keeps asking the tablet for data, though the mockjacks should be fake to my request ...

Any ideas?

I have found this work:

 asyncTest ('feedback Returns jsonp ', function () {$ .mockjax ({url:' http://search.twitter.com/search .json * ', contentType:' text / json ', proxy:' mocks / twitter.json '} ) Function successfully (data) {start (); OK (true, 'jesnop full');} $ .ajax ({url: 'http://search.twitter.com/search.json?q=Javascript& ; Callback =? ', Data type:' jsonp ', success: succeed, error: function () {alert (' error ');}, complete: function () {$ .mockjaxClear ();}}})}} ); A)   

Comments