Skip to content

Commit

Permalink
refactor project
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbokvad committed Oct 3, 2023
1 parent 5d0f1f8 commit 21d1407
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/branchprotection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ describe('BranchProtectionService', () => {
expect(warningStub.called).to.be.true;
expect(exportVariableStub.calledWith('numberOfReviewers', 0)).to.be.true;
});
it('should call warning and set numberOfReviewers to 0 when github repo is private (status = 403)', async () => {
getOctokitStub.returns({
rest: {
repos: {
getBranchProtection: sinon.stub().resolves({
status: 403,
}),
},
},
});

await BranchProtectionService.getStateOfBranchProtection();

expect(warningStub.called).to.be.true;
expect(exportVariableStub.calledWith('numberOfReviewers', 0)).to.be.true;
});
// Add more test cases for different scenarios as needed
});

0 comments on commit 21d1407

Please sign in to comment.