-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests (Sinon) need to be made compatible with Ajax #13
Comments
Hmmm, this was working in 7c831c0 - i.e. before merging your patches (my bad for not checking the merges better ;-0 ...). Could you take a quick look and see what fixes you need to make to get that test passing again with your new code (it may just be you need to stub the fail path or similar). If you have difficulties I can probably help. |
Thank you Rufus. I agree it was caused by my patch (for handling the failure results of ajax queries) - and infact I tried debugging and trying to fix it for about an hour before giving-up and posting here :) For some reason this whole Sinon and ajax thing is elluding me (I am much of c / c++ guy trying to come terms with this javascript recently). I tried searching on the web about why this is happening and looks like they have some good reason (such as Sinon taking over the method prototype etc..) - shared the link in the my original post above - but couldn't figure how to actually resolve it. In this case, I would have to ask for some experts help. Sorry for creating this situation - please help. And my bad - in the past I created two patches (both now merged with main now) - tested one (which passed) and forgot to test the other one (which is creating problem now). And BTW, the changes, however, are creating problem only with Sinon tests - because I have been using the changed code in production - and it never gave any problem. |
@KrishnaPG sinon stuff is just "mocking / stubbing" i.e. you replace the real function (e.g. |
Sinon test case is having difficulty with Ajax queries (such as JQuery.getJSON).
Not a Sinon expert, but I think the explanation given here (http://stackoverflow.com/questions/12088029/how-to-spy-jquery-ajax-request) is applicable to this scenario
The text was updated successfully, but these errors were encountered: