Skip to content

Commit

Permalink
test: fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Dec 9, 2021
1 parent f6b8337 commit e949180
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/platform/github/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7156,6 +7156,14 @@ Array [
]
`;
exports[`platform/github/index initPlatform() should support custom endpoint without version 1`] = `
Object {
"endpoint": "https://ghe.renovatebot.com/",
"gitAuthor": "undefined <[email protected]>",
"renovateUsername": "renovate-bot",
}
`;
exports[`platform/github/index initPlatform() should support default endpoint no email access 1`] = `
Object {
"endpoint": "https://api.github.com/",
Expand Down
24 changes: 24 additions & 0 deletions lib/platform/github/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,30 @@ describe('platform/github/index', () => {
).toMatchSnapshot();
expect(httpMock.getTrace()).toMatchSnapshot();
});

it('should support custom endpoint without version', async () => {
httpMock
.scope('https://ghe.renovatebot.com')
.head('/')
.reply(200)

.get('/user')
.reply(200, {
login: 'renovate-bot',
})
.get('/user/emails')
.reply(200, [
{
email: '[email protected]',
},
]);
expect(
await github.initPlatform({
endpoint: 'https://ghe.renovatebot.com',
token: '123test',
})
).toMatchSnapshot();
});
});

describe('getRepos', () => {
Expand Down

0 comments on commit e949180

Please sign in to comment.