File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ describe('isSameHost', () => {
1919 expect (
2020 isSameHost ( 'https://example.com/' , 'http://example.com/contact' ) ,
2121 ) . toBe ( true ) ;
22+ expect (
23+ isSameHost ( 'https://main.example.com:3000' , 'https://main.example.com' ) ,
24+ ) . toBe ( true ) ;
2225 } ) ;
2326
2427 it ( 'should return true for URLs with and without www' , ( ) => {
@@ -28,11 +31,26 @@ describe('isSameHost', () => {
2831 expect (
2932 isSameHost ( 'http://www.example.com/about' , 'http://example.com/about' ) ,
3033 ) . toBe ( true ) ;
34+ expect (
35+ isSameHost (
36+ 'https://www.main.example.com/contact' ,
37+ 'https://main.example.com' ,
38+ ) ,
39+ ) ;
3140 } ) ;
3241
3342 it ( 'should return false for URLs with different hosts' , ( ) => {
3443 expect (
35- isSameHost ( 'https://example.com' , 'https://anotherexample.com' ) ,
44+ isSameHost (
45+ 'http://example.com' ,
46+ 'https://www.instagram.com/gamegatornet/' ,
47+ ) ,
48+ ) . toBe ( false ) ;
49+ expect (
50+ isSameHost (
51+ 'http://main.example.com' ,
52+ 'https://www.instagram.com/gamegatornet/' ,
53+ ) ,
3654 ) . toBe ( false ) ;
3755 expect (
3856 isSameHost ( 'http://subdomain.example.com' , 'http://example.com' ) ,
You can’t perform that action at this time.
0 commit comments