mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-01 18:19:51 +00:00
930cf6633c
fix: Additional vi.mock path corrections and prettier formatting
22 lines
1023 B
TypeScript
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);
|
|
},
|
|
);
|
|
});
|
|
});
|