Skip to content

Commit

Permalink
Added test to check that promises are returned by all methods
Browse files Browse the repository at this point in the history
  • Loading branch information
billinghamj committed Feb 3, 2015
1 parent e0431f4 commit 8b32aec
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,18 @@ test('correct headers after initialization with custom headers', function (t) {

t.end();
});

test('promise returned by all methods', function (t) {
var client = new PostcodesIO();

t.equal(typeof client.lookup('EC1V 9LB').then, 'function');
t.equal(typeof client.near('EC1V 9LB').then, 'function');
t.equal(typeof client.near(51.6562, -1.0699).then, 'function');
t.equal(typeof client.nearCoordinate(51.6562, -1.0699).then, 'function');
t.equal(typeof client.nearPostcode('EC1V 9LB').then, 'function');
t.equal(typeof client.reverseGeocode(51.6562, -1.0699).then, 'function');
t.equal(typeof client.validate('EC1V 9LB').then, 'function');
t.equal(typeof client.random().then, 'function');

t.end();
});

0 comments on commit 8b32aec

Please sign in to comment.