summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/github-url-from-username-repo/test/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/github-url-from-username-repo/test/index.js')
-rw-r--r--deps/npm/node_modules/github-url-from-username-repo/test/index.js28
1 files changed, 26 insertions, 2 deletions
diff --git a/deps/npm/node_modules/github-url-from-username-repo/test/index.js b/deps/npm/node_modules/github-url-from-username-repo/test/index.js
index 14c7dd16c2..935bb439d3 100644
--- a/deps/npm/node_modules/github-url-from-username-repo/test/index.js
+++ b/deps/npm/node_modules/github-url-from-username-repo/test/index.js
@@ -18,8 +18,8 @@ describe("github url from username/repo", function () {
})
it("works with .", function () {
- var url = getUrl("component/downloader.js")
- assert.equal("https://github.com/component/downloader.js", url)
+ var url = getUrl("component/.download.er.js.")
+ assert.equal("https://github.com/component/.download.er.js.", url)
})
it("works with . in the beginning", function () {
@@ -31,4 +31,28 @@ describe("github url from username/repo", function () {
var url = getUrl("component/-dow-nloader.j-s")
assert.equal("https://github.com/component/-dow-nloader.j-s", url)
})
+
+ it("can handle branches with #", function () {
+ var url = getUrl(
+ "component/entejs#1c3e1fe71640b4b477f04d947bd53c473799b277")
+
+ assert.equal("https://github.com/component/entejs#1c3e1fe71640b" +
+ "4b477f04d947bd53c473799b277", url)
+ })
+
+ describe("browser mode", function () {
+ it("is able to return urls for branches", function () {
+ var url = getUrl(
+ "component/entejs#1c3e1fe71640b4b477f04d947bd53c473799b277", true)
+
+ assert.equal("https://github.com/component/entejs/tree/1c3e1fe71640b" +
+ "4b477f04d947bd53c473799b277", url)
+ })
+ it("is able to return urls without a branch for the browser", function () {
+ var url = getUrl(
+ "component/entejs", true)
+
+ assert.equal("https://github.com/component/entejs", url)
+ })
+ })
})