@@ -13,8 +13,11 @@ test('fromUrl(github url)', function (t) {
13
13
t . is ( hostinfo . https ( ) , 'git+https://github.com/111/222.git' + hash , label + ' -> https' )
14
14
t . is ( hostinfo . git ( ) , 'git://github.com/111/222.git' + hash , label + ' -> git' )
15
15
t . is ( hostinfo . browse ( ) , 'https://github.com/111/222' + treebranch , label + ' -> browse' )
16
+ t . is ( hostinfo . browse ( '' ) , 'https://github.com/111/222/tree/' + ( branch || 'master' ) + '/' , label + ' -> browse("")' )
16
17
t . is ( hostinfo . browse ( 'C' ) , 'https://github.com/111/222/tree/' + ( branch || 'master' ) + '/C' , label + ' -> browse(path)' )
18
+ t . is ( hostinfo . browse ( 'C/D' ) , 'https://github.com/111/222/tree/' + ( branch || 'master' ) + '/C/D' , label + ' -> browse(path)' )
17
19
t . is ( hostinfo . browse ( 'C' , 'A' ) , 'https://github.com/111/222/tree/' + ( branch || 'master' ) + '/C#a' , label + ' -> browse(path, fragment)' )
20
+ t . is ( hostinfo . browse ( 'C/D' , 'A' ) , 'https://github.com/111/222/tree/' + ( branch || 'master' ) + '/C/D#a' , label + ' -> browse(path, fragment)' )
18
21
t . is ( hostinfo . bugs ( ) , 'https://github.com/111/222/issues' , label + ' -> bugs' )
19
22
t . is ( hostinfo . docs ( ) , 'https://github.com/111/222' + treebranch + '#readme' , label + ' -> docs' )
20
23
t . is ( hostinfo . ssh ( ) , '[email protected] :111/222.git' + hash , label + ' -> ssh' )
@@ -24,7 +27,9 @@ test('fromUrl(github url)', function (t) {
24
27
t . is ( hostinfo . hash ( ) , hash , ' -> hash' )
25
28
t . is ( hostinfo . path ( { noCommittish : true } ) , '111/222' , ' -> path (no committish)' )
26
29
t . is ( hostinfo . shortcut ( ) , 'github:111/222' + hash , label + ' -> shortcut' )
30
+ t . is ( hostinfo . file ( '' ) , 'https://raw.githubusercontent.com/111/222/' + ( branch || 'master' ) + '/' , label + ' -> file' )
27
31
t . is ( hostinfo . file ( 'C' ) , 'https://raw.githubusercontent.com/111/222/' + ( branch || 'master' ) + '/C' , label + ' -> file' )
32
+ t . is ( hostinfo . file ( 'C/D' ) , 'https://raw.githubusercontent.com/111/222/' + ( branch || 'master' ) + '/C/D' , label + ' -> file' )
28
33
t . is ( hostinfo . tarball ( ) , 'https://codeload.github.com/111/222/tar.gz/' + ( branch || 'master' ) , label + ' -> tarball' )
29
34
}
30
35
0 commit comments