@@ -24,7 +24,6 @@ describe("github url identifier helper", () => {
2424 describe ( "getNwoFromGitHubUrl method" , ( ) => {
2525 it ( "should handle invalid urls" , ( ) => {
2626 expect ( getNwoFromGitHubUrl ( "" ) ) . toBe ( undefined ) ;
27- expect ( getNwoFromGitHubUrl ( "http://github.com/foo/bar" ) ) . toBe ( undefined ) ;
2827 expect ( getNwoFromGitHubUrl ( "https://ww.github.com/foo/bar" ) ) . toBe (
2928 undefined ,
3029 ) ;
@@ -34,7 +33,10 @@ describe("github url identifier helper", () => {
3433 } ) ;
3534
3635 it ( "should handle valid urls" , ( ) => {
36+ expect ( getNwoFromGitHubUrl ( "github.com/foo/bar" ) ) . toBe ( "foo/bar" ) ;
37+ expect ( getNwoFromGitHubUrl ( "www.github.com/foo/bar" ) ) . toBe ( "foo/bar" ) ;
3738 expect ( getNwoFromGitHubUrl ( "https://github.com/foo/bar" ) ) . toBe ( "foo/bar" ) ;
39+ expect ( getNwoFromGitHubUrl ( "http://github.com/foo/bar" ) ) . toBe ( "foo/bar" ) ;
3840 expect ( getNwoFromGitHubUrl ( "https://www.github.com/foo/bar" ) ) . toBe (
3941 "foo/bar" ,
4042 ) ;
@@ -47,9 +49,6 @@ describe("github url identifier helper", () => {
4749 describe ( "getOwnerFromGitHubUrl method" , ( ) => {
4850 it ( "should handle invalid urls" , ( ) => {
4951 expect ( getOwnerFromGitHubUrl ( "" ) ) . toBe ( undefined ) ;
50- expect ( getOwnerFromGitHubUrl ( "http://github.com/foo/bar" ) ) . toBe (
51- undefined ,
52- ) ;
5352 expect ( getOwnerFromGitHubUrl ( "https://ww.github.com/foo/bar" ) ) . toBe (
5453 undefined ,
5554 ) ;
@@ -58,6 +57,7 @@ describe("github url identifier helper", () => {
5857 } ) ;
5958
6059 it ( "should handle valid urls" , ( ) => {
60+ expect ( getOwnerFromGitHubUrl ( "http://github.com/foo/bar" ) ) . toBe ( "foo" ) ;
6161 expect ( getOwnerFromGitHubUrl ( "https://github.com/foo/bar" ) ) . toBe ( "foo" ) ;
6262 expect ( getOwnerFromGitHubUrl ( "https://www.github.com/foo/bar" ) ) . toBe (
6363 "foo" ,
@@ -66,6 +66,8 @@ describe("github url identifier helper", () => {
6666 getOwnerFromGitHubUrl ( "https://github.com/foo/bar/sub/pages" ) ,
6767 ) . toBe ( "foo" ) ;
6868 expect ( getOwnerFromGitHubUrl ( "https://www.github.com/foo" ) ) . toBe ( "foo" ) ;
69+ expect ( getOwnerFromGitHubUrl ( "github.com/foo" ) ) . toBe ( "foo" ) ;
70+ expect ( getOwnerFromGitHubUrl ( "www.github.com/foo" ) ) . toBe ( "foo" ) ;
6971 } ) ;
7072 } ) ;
7173} ) ;
0 commit comments