mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 12:57:47 +00:00
Run local Project detection during `vc link --repo`. This allows for creation of new Projects that do not yet exist under the selected scope.
35 lines
1019 B
TypeScript
35 lines
1019 B
TypeScript
import { repoInfoToUrl } from '../../../../src/util/git/repo-info-to-url';
|
|
import type { RepoInfo } from '../../../../src/util/git/connect-git-provider';
|
|
|
|
describe('repoInfoToUrl()', () => {
|
|
it('should support "github" URL', () => {
|
|
const info: RepoInfo = {
|
|
provider: 'github',
|
|
org: 'vercel',
|
|
repo: 'foo',
|
|
url: 'git@github.com:vercel/foo.git',
|
|
};
|
|
expect(repoInfoToUrl(info)).toEqual('https://github.com/vercel/foo');
|
|
});
|
|
|
|
it('should support "gitlab" URL', () => {
|
|
const info: RepoInfo = {
|
|
provider: 'gitlab',
|
|
org: 'vercel',
|
|
repo: 'foo',
|
|
url: 'git@gitlab.com:vercel/foo.git',
|
|
};
|
|
expect(repoInfoToUrl(info)).toEqual('https://gitlab.com/vercel/foo');
|
|
});
|
|
|
|
it('should support "bitbucket" URL', () => {
|
|
const info: RepoInfo = {
|
|
provider: 'bitbucket',
|
|
org: 'vercel',
|
|
repo: 'foo',
|
|
url: 'git@bitbucket.com:vercel/foo.git',
|
|
};
|
|
expect(repoInfoToUrl(info)).toEqual('https://bitbucket.com/vercel/foo');
|
|
});
|
|
});
|