Commit d7e9b763 authored by Patricio Bruna's avatar Patricio Bruna

test parseResponse with error null

parent 49e8aeed
...@@ -286,7 +286,7 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -286,7 +286,7 @@ return /******/ (function(modules) { // webpackBootstrap
var response_name = that.dictionary.resourceResponseName(resource); var response_name = that.dictionary.resourceResponseName(resource);
var response_object = data.get()[request_data.response_name][response_name][0]; var response_object = data.get()[request_data.response_name][response_name][0];
var result = that.dictionary.classFactory(resource, response_object, that); var result = that.dictionary.classFactory(resource, response_object, that);
return callback(true, result); return callback(null, result);
} }
// For requests that returns empty Object when Success // For requests that returns empty Object when Success
This diff is collapsed.
...@@ -177,7 +177,7 @@ export default class ZimbraAdminApi { ...@@ -177,7 +177,7 @@ export default class ZimbraAdminApi {
const response_name = that.dictionary.resourceResponseName(resource); const response_name = that.dictionary.resourceResponseName(resource);
const response_object = data.get()[request_data.response_name][response_name][0]; const response_object = data.get()[request_data.response_name][response_name][0];
const result = that.dictionary.classFactory(resource, response_object, that); const result = that.dictionary.classFactory(resource, response_object, that);
return callback(true, result); return callback(null, result);
} }
// For requests that returns empty Object when Success // For requests that returns empty Object when Success
......
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
let api = new ZimbraAdminApi(auth_data); let api = new ZimbraAdminApi(auth_data);
let callback = function(err, response) { let callback = function(err, response) {
if (err) return console.error(err); if (err) return console.error(err);
console.log(api.client);
expect(api.client.token).to.exist; expect(api.client.token).to.exist;
done(); done();
}; };
...@@ -134,6 +133,7 @@ ...@@ -134,6 +133,7 @@
let callback = function(err, data){ let callback = function(err, data){
let domain_id = data.id; let domain_id = data.id;
api.getDomain(domain_id, function(err, data){ api.getDomain(domain_id, function(err, data){
if (err) return console.error(err);
expect(data.name).to.equal('zboxapp.dev'); expect(data.name).to.equal('zboxapp.dev');
done(); done();
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment