Skip to content

Commit 7d9afd0

Browse files
committed
refactor: rename Team.getRepos to Team.listRepos
1 parent 2aa5c11 commit 7d9afd0

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

lib/Team.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Team extends Requestable {
4141
* @param {Requestable.callback} [cb] - will receive the list of repositories
4242
* @return {Promise} - the promise for the http request
4343
*/
44-
getRepos(cb) {
44+
listRepos(cb) {
4545
log(`Fetching repositories for Team ${this.__teamId}`);
4646
return this._requestAllPages(`/teams/${this.__teamId}/repos`, undefined, cb);
4747
}

test/team.spec.js

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,45 +58,47 @@ describe('Team', function() { // Isolate tests that are based on a fixed team
5858

5959
let hasTestUser = members.reduce(
6060
(found, member) => member.login === testUser.USERNAME || found,
61-
false);
61+
false
62+
);
6263

6364
expect(hasTestUser).to.be.true();
6465
});
6566
});
6667

6768
it('should get team repos', function() {
68-
return team.getRepos()
69-
.then(({data}) => {
70-
const hasRepo = data.reduce(
71-
(found, repo) => repo.name === 'fixed-test-repo-1' || found,
72-
false);
73-
74-
expect(hasRepo).to.be.true();
75-
});
69+
return team.listRepos()
70+
.then(({data}) => {
71+
const hasRepo = data.reduce(
72+
(found, repo) => repo.name === 'fixed-test-repo-1' || found,
73+
false
74+
);
75+
76+
expect(hasRepo).to.be.true();
77+
});
7678
});
7779

7880
it('should get team', function() {
7981
return team.getTeam()
80-
.then(({data}) => {
81-
expect(data.name).to.equal('Fixed Test Team 1');
82-
});
82+
.then(({data}) => {
83+
expect(data.name).to.equal('Fixed Test Team 1');
84+
});
8385
});
8486

8587
it('should check if team manages repo', function() {
8688
return team.isManagedRepo(testUser.ORGANIZATION, 'fixed-test-repo-1')
87-
.then((result) => {
88-
expect(result).to.be.true();
89-
});
89+
.then((result) => {
90+
expect(result).to.be.true();
91+
});
9092
});
9193
});
9294

9395
describe('Team', function() { // Isolate tests that need a new team per test
9496
beforeEach(function() {
9597
return createTestTeam()
96-
.then((x) => {
97-
team = x.team;
98-
name = x.name;
99-
});
98+
.then((x) => {
99+
team = x.team;
100+
name = x.name;
101+
});
100102
});
101103

102104
// Test for Team deletion
@@ -108,9 +110,9 @@ describe('Team', function() { // Isolate tests that need a new team per test
108110
it('should update team', function() {
109111
const newName = `${name}-updated`;
110112
return team.editTeam({name: newName})
111-
.then(function({data}) {
112-
expect(data.name).to.equal(newName);
113-
});
113+
.then(function({data}) {
114+
expect(data.name).to.equal(newName);
115+
});
114116
});
115117

116118
it('should add membership for a given user', function() {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy