Skip to content

Commit

Permalink
-changed: ignoring hg and svn repos in get All Repos function
Browse files Browse the repository at this point in the history
-fixed: failing test
  • Loading branch information
zT-1337 committed Jan 24, 2024
1 parent cdebb21 commit cfc6e19
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/modules/platform/scmm/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ describe('modules/platform/scmm/index', () => {
.mockResolvedValueOnce([
repo,
{ ...repo, namespace: 'other', name: 'repository' },
{ ...repo, namespace: 'other', name: 'mercurial', type: 'hg'},
{ ...repo, namespace: 'other', name: 'subversion', type: 'svn'}
]);

expect(await getRepos()).toEqual(['default/repo', 'other/repository']);
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/platform/scmm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export async function initRepo({
}

export async function getRepos(): Promise<string[]> {
const repos = await scmmClient.getAllRepos();
const repos = (await scmmClient.getAllRepos()).filter(repo => repo.type === 'git');
const result = repos.map((repo) => `${repo.namespace}/${repo.name}`);
logger.info(`Discovered ${repos.length} repos`);

Expand Down
13 changes: 11 additions & 2 deletions lib/modules/platform/scmm/scm-client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,22 @@ describe('modules/platform/scmm/scm-client', () => {
.put(`/pull-requests/${repo.namespace}/${repo.name}/${expectedPrId}`)
.reply(204);

expect(
/*expect(
await scmClient.updatePr(
`${repo.namespace}/${repo.name}`,
expectedPrId,
expectedUpdateParams
)
).not.toThrow();
).not.toThrow();*/
await expect(
scmClient.updatePr(
`${repo.namespace}/${repo.name}`,
expectedPrId,
expectedUpdateParams
)
).resolves.not.toThrowError();


});

it.each([[400], [401], [403], [404], [500]])(
Expand Down

0 comments on commit cfc6e19

Please sign in to comment.