1- import {
2- getNumberOfUrlSegments ,
3- getSanitizedUrlString ,
4- parseUrl ,
5- stripUrlQueryAndFragment ,
6- } from '../../src/utils-hoist/url' ;
1+ import { getSanitizedUrlString , parseUrl , stripUrlQueryAndFragment } from '../../src/utils-hoist/url' ;
72
83describe ( 'stripQueryStringAndFragment' , ( ) => {
94 const urlString = 'http://dogs.are.great:1231/yay/' ;
@@ -26,18 +21,6 @@ describe('stripQueryStringAndFragment', () => {
2621 } ) ;
2722} ) ;
2823
29- describe ( 'getNumberOfUrlSegments' , ( ) => {
30- test . each ( [
31- [ 'regular path' , '/projects/123/views/234' , 4 ] ,
32- [ 'single param parameterized path' , '/users/:id/details' , 3 ] ,
33- [ 'multi param parameterized path' , '/stores/:storeId/products/:productId' , 4 ] ,
34- [ 'regex path' , String ( / \/ a p i \/ p o s t [ 0 - 9 ] / ) , 2 ] ,
35- ] ) ( '%s' , ( _ : string , input , output ) => {
36- // eslint-disable-next-line deprecation/deprecation
37- expect ( getNumberOfUrlSegments ( input ) ) . toEqual ( output ) ;
38- } ) ;
39- } ) ;
40-
4124describe ( 'getSanitizedUrlString' , ( ) => {
4225 it . each ( [
4326 [ 'regular url' , 'https://somedomain.com' , 'https://somedomain.com' ] ,
0 commit comments