When I run this test:
describe("Smoke process request tests", function () {
"use strict";
it("should echo the test request with response", function () {
var test = { act: 'test', qry: {} };
webix.ajax().post("http://localhost:3000/request", JSON.stringify(test))
.then(function (resp) {
expect(resp.json().requests.find(function (el) {
console.log(el);
return el.action === 'test';
})).to.eql(test);
done();
}).fail(function (errs) {
throw(errs);
});
});
});
the then or fail functions are never called. When I perform webix.ajax().sync() then I get an error.
How can I test ajax actions using Karma?