@@ -13,8 +13,11 @@ test('fromUrl(github url)', function (t) {
1313 t . is ( hostinfo . https ( ) , 'git+https://github.com/111/222.git' + hash , label + ' -> https' )
1414 t . is ( hostinfo . git ( ) , 'git://github.com/111/222.git' + hash , label + ' -> git' )
1515 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("")' )
1617 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)' )
1719 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)' )
1821 t . is ( hostinfo . bugs ( ) , 'https://github.com/111/222/issues' , label + ' -> bugs' )
1922 t . is ( hostinfo . docs ( ) , 'https://github.com/111/222' + treebranch + '#readme' , label + ' -> docs' )
2023 t . is ( hostinfo . ssh ( ) , '[email protected] :111/222.git' + hash , label + ' -> ssh' ) @@ -24,7 +27,9 @@ test('fromUrl(github url)', function (t) {
2427 t . is ( hostinfo . hash ( ) , hash , ' -> hash' )
2528 t . is ( hostinfo . path ( { noCommittish : true } ) , '111/222' , ' -> path (no committish)' )
2629 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' )
2731 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' )
2833 t . is ( hostinfo . tarball ( ) , 'https://codeload.github.com/111/222/tar.gz/' + ( branch || 'master' ) , label + ' -> tarball' )
2934 }
3035
0 commit comments