Reputation: 14416
I have this code that is getting called from my jasmine test.
$.mockjax({
url: "/test",
contentType: "text/json",
responseText: { number: 14.0 }
});
$.ajax({
url: "/test",
dataType: "json"
}).done(function (data) {
console.log(data);
});
I get the green window come up and then bring up the console, f5 to re-run the tests and nothing is coming though.
So i click the big DEBUG button in the top right and press f5 in there with the console open and it is is outputting the data.
Why would .done only get hit within the debug mode?
When i step though using each window, it is totally skipping .done where-as i can see it doing into done when in debug.
Upvotes: 0
Views: 187
Reputation: 14416
Of course, Jasmine is not asynchonsous unless you do some extra work.
I checked the documentation and managed to get it to work by using the waitsFor method.
https://github.com/pivotal/jasmine/wiki/Asynchronous-specs
Upvotes: 1