mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-09 21:46:26 +00:00
AutomergeFailureComment Testing Implemented
This commit is contained in:
parent
679a0a8a71
commit
e03b4117a3
2 changed files with 6 additions and 16 deletions
|
@ -2002,7 +2002,7 @@ const options: RenovateOptions[] = [
|
|||
description:
|
||||
'If an error occurs while automerging, a comment will be created to signal the user. Only used if `automergeFailureComment=on-error`.',
|
||||
type: 'string',
|
||||
default: 'none',
|
||||
default: 'never',
|
||||
},
|
||||
{
|
||||
name: 'ignoreTests',
|
||||
|
|
|
@ -2990,22 +2990,12 @@ describe('modules/platform/github/index', () => {
|
|||
|
||||
it('should handle GraphQL errors with automergeFailureComment', async () => {
|
||||
const scope = await mockScope({ automergeFailureComment: 'on-error' });
|
||||
initRepoMock(scope, 'some/repo');
|
||||
scope
|
||||
.get('/repos/some/repo/issues/42/comments?per_page=100')
|
||||
.reply(200, [])
|
||||
.post('/repos/some/repo/issues/42/comments')
|
||||
.reply(200);
|
||||
await github.initRepo({ repository: 'some/repo' });
|
||||
scope.post('/graphql').reply(200, graphqlAutomergeErrorResp);
|
||||
const pr = await github.createPr(prConfigComment);
|
||||
expect(pr).toMatchObject({ number: 123 });
|
||||
expect(httpMock.getTrace()).toMatchObject([
|
||||
graphqlGetRepo,
|
||||
restCreatePr,
|
||||
restAddLabels,
|
||||
graphqlAutomerge,
|
||||
]);
|
||||
.post('/repos/some/repo/issues/123/comments')
|
||||
.reply(200)
|
||||
.post('/graphql')
|
||||
.reply(200, graphqlAutomergeErrorResp);
|
||||
await expect(github.createPr(prConfigComment)).toResolve();
|
||||
});
|
||||
|
||||
it('should handle REST API errors', async () => {
|
||||
|
|
Loading…
Reference in a new issue