Skip to content

Commit 0566acb

Browse files
committed
Merge branch 'fix-name-parsing' of https://github.com/pvdlg/git-url-parse
2 parents 80ecaf0 + 7ee10a6 commit 0566acb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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

1617
tester.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");

0 commit comments

Comments
 (0)