Skip to content

Commit

Permalink
set a default for authType, fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed Jul 31, 2023
1 parent 8ba6ad1 commit 80857c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion services/github/github-api-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GithubApiProvider {
// reserve it for the user.
constructor({
baseUrl,
authType,
authType = this.constructor.AUTH_TYPES.NO_AUTH,
onTokenInvalidated = tokenString => {},
globalToken,
reserveFraction = 0.25,
Expand Down
6 changes: 5 additions & 1 deletion services/github/github-api-provider.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ describe('Github API provider', function () {

let mockStandardToken, mockSearchToken, mockGraphqlToken, provider
beforeEach(function () {
provider = new GithubApiProvider({ baseUrl, reserveFraction })
provider = new GithubApiProvider({
baseUrl,
authType: GithubApiProvider.AUTH_TYPES.TOKEN_POOL,
reserveFraction,
})

mockStandardToken = { update: sinon.spy(), invalidate: sinon.spy() }
sinon.stub(provider.standardTokens, 'next').returns(mockStandardToken)
Expand Down
1 change: 1 addition & 0 deletions services/github/github-auth-service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('GithubAuthV3Service', function () {
)
const githubApiProvider = new GithubApiProvider({
baseUrl: 'https://github-api.example.com',
authType: GithubApiProvider.AUTH_TYPES.TOKEN_POOL,
restApiVersion: '2022-11-28',
})
const mockToken = { update: sinon.mock(), invalidate: sinon.mock() }
Expand Down

0 comments on commit 80857c5

Please sign in to comment.