File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const URLS = {
1111 , ftps : "ftps://github.com/IonicaBizau/git-url-parse"
1212 , gitSsh : "git+ssh://git@github.com/IonicaBizau/git-url-parse"
1313 , ref : "https://github.com/IonicaBizau/git-url-parse/blob/master/test/index.js"
14+ , shorthand : "IonicaBizau/git-url-parse"
1415} ;
1516
1617tester . describe ( "parse urls" , test => {
@@ -201,6 +202,16 @@ tester.describe("parse urls", test => {
201202 test . expect ( res . filepath ) . toBe ( "test/index.js" ) ;
202203 } ) ;
203204
205+ // shorthand urls
206+ test . should ( "parse shorthand urls" , ( ) => {
207+ var res = gitUrlParse ( URLS . shorthand ) ;
208+ test . expect ( res . owner ) . toBe ( "IonicaBizau" ) ;
209+ test . expect ( res . name ) . toBe ( "git-url-parse" ) ;
210+ test . expect ( res . href ) . toBe ( URLS . shorthand ) ;
211+ test . expect ( res . full_name ) . toBe ( "IonicaBizau/git-url-parse" ) ;
212+ test . expect ( res . pathname ) . toBe ( "IonicaBizau/git-url-parse" ) ;
213+ } ) ;
214+
204215 test . should ( "parse subdomains" , ( ) => {
205216 var res = gitUrlParse ( "https://gist.github.com/owner/id" ) ;
206217 test . expect ( res . source ) . toBe ( "github.com" ) ;
You can’t perform that action at this time.
0 commit comments