scaffolder-backend-module-github: test fix for conditional throw in mock
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -755,8 +755,12 @@ describe('publish:github', () => {
|
||||
},
|
||||
});
|
||||
|
||||
mockOctokit.rest.teams.addOrUpdateRepoPermissionsInOrg.mockRejectedValueOnce(
|
||||
new Error('Something bad happened'),
|
||||
mockOctokit.rest.teams.addOrUpdateRepoPermissionsInOrg.mockImplementation(
|
||||
async opts => {
|
||||
if (opts.team_slug === 'robot-1') {
|
||||
throw Error('Something bad happened');
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
await action.handler({
|
||||
|
||||
@@ -477,8 +477,12 @@ describe('github:repo:create', () => {
|
||||
},
|
||||
});
|
||||
|
||||
mockOctokit.rest.teams.addOrUpdateRepoPermissionsInOrg.mockRejectedValueOnce(
|
||||
new Error('Something bad happened'),
|
||||
mockOctokit.rest.teams.addOrUpdateRepoPermissionsInOrg.mockImplementation(
|
||||
async opts => {
|
||||
if (opts.team_slug === 'robot-1') {
|
||||
throw Error('Something bad happened');
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
await action.handler({
|
||||
|
||||
Reference in New Issue
Block a user