Skip to content

Commit

Permalink
chore: fix broken tests (#474)
Browse files Browse the repository at this point in the history
  • Loading branch information
miyajan authored and clayreimann committed Sep 26, 2017
1 parent 33bee0e commit 24223f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Requestable.js
Expand Up @@ -256,7 +256,7 @@ class Requestable {
results.push(...thisGroup);

const nextUrl = getNextPage(response.headers.link);
if (nextUrl && typeof options.page !== 'number') {
if (nextUrl && !(options && typeof options.page !== 'number')) {
log(`getting next page: ${nextUrl}`);
return this._requestAllPages(nextUrl, options, cb, results);
}
Expand Down
6 changes: 4 additions & 2 deletions test/organization.spec.js
Expand Up @@ -17,11 +17,13 @@ describe('Organization', function() {
password: testUser.PASSWORD,
auth: 'basic',
});
return;
createdProject = undefined;
});

after(function() {
return github.getProject(createdProject.id).deleteProject();
if (createdProject) {
return github.getProject(createdProject.id).deleteProject();
}
});

describe('reading', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/team.spec.js
Expand Up @@ -159,7 +159,7 @@ describe('Team', function() { // Isolate tests that need a new team per test
});

it('should add membership for a given user', function() {
return team.addMembership(testUser.USERNAME)
return team.addMembership(altUser.USERNAME)
.then(({data}) => {
const {state, role} = data;
expect(state === 'active' || state === 'pending').to.be.true();
Expand Down

0 comments on commit 24223f7

Please sign in to comment.