During writing tests for yii.js in Yii 2 framework I faced with problem of testing AJAX requests with types script
and jsonp
. I use Sinon.JS as a stubbing library, it has a wonderful feature called Fake server which comes in handy exactly for testing AJAX.