Hi,
I am working on unit testing of my custom widget. I am unable to receive the response from XMLHttpRequest requests.Can some one please help me.Here I have copied a simple XML HTTP request.I am getting the same problem with dojoPromise response as well.
unit test method----
'Test getTravelModes':function(){
var defferd = this.async(1000);
testApp.getTravelModes().then(defferd.callback(
function(data) {
console.log(data);
assert.equal(response,8,'travel modes count matches');
}, function(err) {
console.log(err);
}));
}
widget method----
getTravelModes:function(){
var travelModes = [];
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
console.log(this.status + " " + this.readyState);
if (this.readyState == 4 && this.status == 200) {