Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d9afd0

Browse files
committed
refactor: rename Team.getRepos to Team.listRepos
1 parent2aa5c11 commit7d9afd0

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
returnthis._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
lethasTestUser=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-
returnteam.getRepos()
69-
.then(({data})=>{
70-
consthasRepo=data.reduce(
71-
(found,repo)=>repo.name==='fixed-test-repo-1'||found,
72-
false);
73-
74-
expect(hasRepo).to.be.true();
75-
});
69+
returnteam.listRepos()
70+
.then(({data})=>{
71+
consthasRepo=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
returnteam.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
returnteam.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
returncreateTestTeam()
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
constnewName=`${name}-updated`;
110112
returnteam.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)

[8]ページ先頭

©2009-2025 Movatter.jp