fix: Do not pass scp-style URLs to the WhatWG url.URL · npm/hosted-git-info@f2cdfcf

Original file line numberDiff line numberDiff line change

@@ -37,6 +37,8 @@ test('basic', function (t) {

3737

t.is(HostedGit.fromUrl('github.com/abc/def/'), undefined, 'forgot the protocol')

3838

t.is(HostedGit.fromUrl('completely-invalid'), undefined, 'not a url is not hosted')

3939
40+

t.is(HostedGit.fromUrl('git+ssh://git@git.unlucky.com:RND/electron-tools/some-tool#2.0.1'), undefined, 'properly ignores non-hosted scp style urls')

41+
4042

t.is(HostedGit.fromUrl('http://github.com/foo/bar').toString(), 'git+ssh://git@github.com/foo/bar.git', 'github http protocol use git+ssh urls')

4143

t.end()

4244

})