Skip to content

Commit

Permalink
Merge branch 'release-v1.2.6' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ludovic-gonthier committed May 23, 2016
2 parents bfaf8f3 + 75eb7e7 commit 8a25a7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "snowshoe",
"version": "1.2.5",
"version": "1.2.6",
"description": "GitHub dashboard to keep tracks on your ongoing PR",
"author": {
"name": "Ludovic Gonthier",
Expand Down
21 changes: 6 additions & 15 deletions tests/common/github/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,22 @@ describe('fetcher', () => {
.catch(reject);
});
});
it('should resolve the promise with empty array on error', () => {
it('should reject the promise on error', () => {
stubs.url_formatter
.withArgs('/user/orgs', { per_page: 100 })
.returns('https://api.github.com/user/orgs?per_page=100');
stubs.request.paginate
.withArgs('https://api.github.com/user/orgs?per_page=100', 'organization')
.returns(Promise.reject(new Error('Pagination error')));
console.error = sinon.stub(); // eslint-disable-line no-console

requestStub
.withArgs('test_token')
.returns(stubs.request);

return new Promise((resolve, reject) => {
organizations('test_token')
.then(data => {
expect(console.error).to.have.been.called; // eslint-disable-line no-console
expect(data).to.eql([]);
resolve();
})
.catch(reject);
.then(() => reject(new Error('Promise should have been rejected')))
.catch(resolve);
});
});
});
Expand Down Expand Up @@ -117,20 +112,16 @@ describe('fetcher', () => {
stubs.request.paginate
.withArgs('https://api.github.com/orgs/snowshoe/teams?per_page=100', 'team')
.returns(Promise.reject(new Error('Pagination error')));
console.error = sinon.stub(); // eslint-disable-line no-console

requestStub
.withArgs('test_token')
.returns(stubs.request);

return new Promise((resolve, reject) => {
teams('test_token', 'snowshoe')
.then(data => {
expect(console.error).to.have.been.called; // eslint-disable-line no-console
expect(data).to.eql([]);
resolve();
})
.catch(reject);
.then(() => reject(new Error('Promise should have been rejected')))
.catch(resolve);

});
});
});
Expand Down

0 comments on commit 8a25a7d

Please sign in to comment.