Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKat Marchán <kzm@sykosomatic.org>2015-06-19 03:50:30 +0300
committerRebecca Turner <me@re-becca.org>2015-06-27 07:50:49 +0300
commitf2bca59e8fdf47677a2d110f45aa84d8fb218438 (patch)
tree33fca36cee23c42f98e36eec5fb3ab8ef64612f9 /test
parent09d1bbeba6c5348c0f0ec54c6383416f21daddd9 (diff)
cache: some remote specs aren't URLs; don't break
Fixes #8031 PR-URL: https://github.com/npm/npm/pull/8673
Diffstat (limited to 'test')
-rw-r--r--test/tap/add-remote-git-get-resolved.js25
1 files changed, 16 insertions, 9 deletions
diff --git a/test/tap/add-remote-git-get-resolved.js b/test/tap/add-remote-git-get-resolved.js
index 4a4f0a5fe..d66929b65 100644
--- a/test/tap/add-remote-git-get-resolved.js
+++ b/test/tap/add-remote-git-get-resolved.js
@@ -74,9 +74,16 @@ test('add-remote-git#get-resolved HTTPS', function (t) {
test('add-remote-git#get-resolved edge cases', function (t) {
var getResolved = require('../../lib/cache/add-remote-git.js').getResolved
- t.notOk(
- getResolved('git@bananaboat.com:galbi.git', 'decadacefadabade'),
- 'non-hosted Git SSH non-URI strings are invalid'
+ t.equal(
+ getResolved('git+ssh://user@bananaboat.com:galbi/blah.git', 'decadacefadabade'),
+ 'git+ssh://user@bananaboat.com:galbi/blah.git#decadacefadabade',
+ 'don\'t break non-hosted scp-style locations'
+ )
+
+ t.equal(
+ getResolved('git+ssh://bananaboat:galbi/blah', 'decadacefadabade'),
+ 'git+ssh://bananaboat:galbi/blah#decadacefadabade',
+ 'don\'t break non-hosted scp-style locations'
)
t.equal(
@@ -86,16 +93,16 @@ test('add-remote-git#get-resolved edge cases', function (t) {
)
t.equal(
+ getResolved('git+ssh://git.bananaboat.net:/foo', 'decadacefadabade'),
+ 'git+ssh://git.bananaboat.net:/foo#decadacefadabade',
+ 'don\'t break non-hosted SSH URLs'
+ )
+
+ t.equal(
getResolved('git://gitbub.com/foo/bar.git', 'decadacefadabade'),
'git://gitbub.com/foo/bar.git#decadacefadabade',
'don\'t break non-hosted git: URLs'
)
- t.comment('test for https://github.com/npm/npm/issues/3224')
- t.equal(
- getResolved('git+ssh://git@git.example.com:my-repo.git#9abe82cb339a70065e75300f62b742622774693c', 'decadacefadabade'),
- 'git+ssh://git@git.example.com:my-repo.git#decadacefadabade',
- 'preserve weird colon in semi-standard ssh:// URLs'
- )
t.end()
})