Skip to content

Commit 24223f7

Browse files
miyajanclayreimann
authored andcommitted
chore: fix broken tests (#474)
1 parent 33bee0e commit 24223f7

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/Requestable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class Requestable {
256256
results.push(...thisGroup);
257257

258258
const nextUrl = getNextPage(response.headers.link);
259-
if (nextUrl && typeof options.page !== 'number') {
259+
if (nextUrl && !(options && typeof options.page !== 'number')) {
260260
log(`getting next page: ${nextUrl}`);
261261
return this._requestAllPages(nextUrl, options, cb, results);
262262
}

test/organization.spec.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ describe('Organization', function() {
1717
password: testUser.PASSWORD,
1818
auth: 'basic',
1919
});
20-
return;
20+
createdProject = undefined;
2121
});
2222

2323
after(function() {
24-
return github.getProject(createdProject.id).deleteProject();
24+
if (createdProject) {
25+
return github.getProject(createdProject.id).deleteProject();
26+
}
2527
});
2628

2729
describe('reading', function() {

test/team.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe('Team', function() { // Isolate tests that need a new team per test
159159
});
160160

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

0 commit comments

Comments
 (0)