@@ -22,6 +22,13 @@ describe('canonicalizeRepoUrl', () => {
2222 [ 'gitlab:group/project' , 'https://gitlab.com/group/project' , 'gitlab' ] ,
2323 [ 'bitbucket:team/repo' , 'https://bitbucket.org/team/repo' , 'bitbucket' ] ,
2424 [ 'https://example.com/owner/repo' , 'https://example.com/owner/repo' , 'other' ] ,
25+ [ 'git+https://github.com/1aGh/md-claude.git' , 'https://github.com/1agh/md-claude' , 'github' ] ,
26+ [
27+ 'ssh://git@github.com:1inch/limit-order-protocol-utils.git' ,
28+ 'https://github.com/1inch/limit-order-protocol-utils' ,
29+ 'github' ,
30+ ] ,
31+ [ 'ssh://git@github.com:2222/foo/bar.git' , 'https://github.com/foo/bar' , 'github' ] ,
2532 ] ) ( 'canonicalizes %s' , ( input , expectedUrl , expectedHost ) => {
2633 expect ( canonicalizeRepoUrl ( input ) ) . toEqual ( { url : expectedUrl , host : expectedHost } )
2734 } )
@@ -44,10 +51,14 @@ describe('canonicalizeRepoUrl', () => {
4451 } )
4552 } )
4653
47- it . each ( [ [ 'not a url' ] , [ 'https://github.com/onlyowner' ] , [ '' ] , [ ' ' ] ] ) (
48- 'returns null for unparseable input %s' ,
49- ( input ) => {
50- expect ( canonicalizeRepoUrl ( input ) ) . toBeNull ( )
51- } ,
52- )
54+ it . each ( [
55+ [ 'not a url' ] ,
56+ [ 'https://github.com/onlyowner' ] ,
57+ [ '' ] ,
58+ [ ' ' ] ,
59+ [ '123' ] ,
60+ [ 'https://github.com/Wscats' ] ,
61+ ] ) ( 'returns null for unparseable input %s' , ( input ) => {
62+ expect ( canonicalizeRepoUrl ( input ) ) . toBeNull ( )
63+ } )
5364} )
0 commit comments