diff --git a/lib/base.js b/lib/base.js index 9a246d3..2607a50 100644 --- a/lib/base.js +++ b/lib/base.js @@ -113,6 +113,7 @@ export class PlivoResourceInterface { client('GET', action, params) .then(response => { let objects = []; + Object.defineProperty(objects, 'meta', {value: response.body.meta}); response.body.objects.forEach(item => { objects.push(new Klass(client, item)); }); @@ -141,4 +142,3 @@ export class PlivoResourceInterface { } } - diff --git a/lib/rest/request-test.js b/lib/rest/request-test.js index 80f8bd3..057e0bb 100644 --- a/lib/rest/request-test.js +++ b/lib/rest/request-test.js @@ -30,6 +30,10 @@ export function Request(config) { options.proxy = config.proxy; } + if (typeof config.timeout !== 'undefined') { + options.timeout = config.timeout; + } + return new Promise((resolve, reject) => { // LiveCall - needs to be at top if (method === 'GET' && action === 'Call/6653422-91b6-4716-9fad-9463daaeeec2/' && params.status === 'live') { diff --git a/test/applications.js b/test/applications.js index a5e6fa0..bc95371 100644 --- a/test/applications.js +++ b/test/applications.js @@ -20,6 +20,13 @@ describe('Application', function () { }) }); + it('has meta information', function () { + return client.applications.list() + .then(function(applications) { + assert.equal(applications.meta.total_count, 19) + }) + }); + it('should create application via interface', function () { return client.applications.create('appName') .then(function(application){ diff --git a/test/calls.js b/test/calls.js index b4424a4..f60efee 100644 --- a/test/calls.js +++ b/test/calls.js @@ -280,7 +280,7 @@ describe('calls', function () { it('should get a livecall', function () { return client.calls.getLiveCall('6653422-91b6-4716-9fad-9463daaeeec2') .then(function (resp) { - console.log(resp); + // console.log(resp); assert.equal(resp.callUuid, '6653422-91b6-4716-9fad-9463daaeeec2'); }); });