Skip to content

Commit

Permalink
Merge branch 'fix-name-parsing' of https://github.com/pvdlg/git-url-p…
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed May 28, 2018
2 parents 80ecaf0 + 7ee10a6 commit 0566acb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/index.js
Expand Up @@ -11,6 +11,7 @@ const URLS = {
, ftps: "ftps://github.com/IonicaBizau/git-url-parse"
, gitSsh: "git+ssh://git@github.com/IonicaBizau/git-url-parse"
, ref: "https://github.com/IonicaBizau/git-url-parse/blob/master/test/index.js"
, shorthand: "IonicaBizau/git-url-parse"
};

tester.describe("parse urls", test => {
Expand Down Expand Up @@ -201,6 +202,16 @@ tester.describe("parse urls", test => {
test.expect(res.filepath).toBe("test/index.js");
});

// shorthand urls
test.should("parse shorthand urls", () => {
var res = gitUrlParse(URLS.shorthand);
test.expect(res.owner).toBe("IonicaBizau");
test.expect(res.name).toBe("git-url-parse");
test.expect(res.href).toBe(URLS.shorthand);
test.expect(res.full_name).toBe("IonicaBizau/git-url-parse");
test.expect(res.pathname).toBe("IonicaBizau/git-url-parse");
});

test.should("parse subdomains", () => {
var res = gitUrlParse("https://gist.github.com/owner/id");
test.expect(res.source).toBe("github.com");
Expand Down

0 comments on commit 0566acb

Please sign in to comment.