Files
renovate/lib/modules/datasource/go/common.spec.ts
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00

22 lines
1023 B
TypeScript

import { getSourceUrl } from './common.ts';
describe('modules/datasource/go/common', () => {
describe('getSourceUrl', () => {
it.each`
expected | datasource | packageName
${'https://bitbucket.org/foo/bar'} | ${'bitbucket-tags'} | ${'foo/bar'}
${'https://code.forgejo.org/go-chi/cache'} | ${'forgejo-tags'} | ${'go-chi/cache'}
${'https://gitea.com/go-chi/cache'} | ${'gitea-tags'} | ${'go-chi/cache'}
${'https://github.com/go-foo/foo'} | ${'github-tags'} | ${'go-foo/foo'}
${'https://gitlab.com/foo/bar'} | ${'gitlab-tags'} | ${'foo/bar'}
${undefined} | ${'git-tags'} | ${'https://dev.azure.com/foo/bar/_git/baz'}
`(
'($datasource, $packageName) => $expected',
({ expected, datasource, packageName }) => {
const res = getSourceUrl({ datasource, packageName });
expect(res).toEqual(expected);
},
);
});
});