@@ -99,7 +99,7 @@ describe('NavigationProvider', () => {
9999 it ( 'should handle pathological input efficiently (ReDoS protection)' , ( ) => {
100100 // Create a string with many consecutive slashes to test performance
101101 // This would cause ReDoS with certain regex patterns
102- const manySlashes = ' /apps' + ' /'. repeat ( 10000 ) + ' my-app' ;
102+ const manySlashes = ` /apps/ ${ ' /'. repeat ( 10000 ) } my-app` ;
103103
104104 const startTime = Date . now ( ) ;
105105 const provider = new NavigationProvider ( {
@@ -117,7 +117,7 @@ describe('NavigationProvider', () => {
117117 it ( 'should handle pathological trailing slashes efficiently (ReDoS protection)' , ( ) => {
118118 // Create a string with many trailing slashes
119119 // The /\/+$/ regex pattern would cause ReDoS with this input
120- const manyTrailingSlashes = ' /apps/my-app' + ' /'. repeat ( 10000 ) ;
120+ const manyTrailingSlashes = ` /apps/my-app${ ' /'. repeat ( 10000 ) } ` ;
121121
122122 const startTime = Date . now ( ) ;
123123 const provider = new NavigationProvider ( {
@@ -150,9 +150,13 @@ describe('NavigationProvider', () => {
150150 } ) ;
151151
152152 // All paths should be in scope
153+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
153154 expect ( ( provider as any ) . _isWithinBasenameScope ( '/' ) ) . toBe ( true ) ;
155+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
154156 expect ( ( provider as any ) . _isWithinBasenameScope ( '/apps' ) ) . toBe ( true ) ;
157+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
155158 expect ( ( provider as any ) . _isWithinBasenameScope ( '/apps/my-app' ) ) . toBe ( true ) ;
159+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
156160 expect ( ( provider as any ) . _isWithinBasenameScope ( '/apps/my-app/users' ) ) . toBe ( true ) ;
157161
158162 provider . dispose ( ) ;
@@ -165,18 +169,25 @@ describe('NavigationProvider', () => {
165169 } ) ;
166170
167171 // Exact match should be in scope
172+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
168173 expect ( ( provider as any ) . _isWithinBasenameScope ( '/apps/my-app' ) ) . toBe ( true ) ;
169174
170175 // Paths starting with basename/ should be in scope
176+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
171177 expect ( ( provider as any ) . _isWithinBasenameScope ( '/apps/my-app/' ) ) . toBe ( true ) ;
178+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
172179 expect ( ( provider as any ) . _isWithinBasenameScope ( '/apps/my-app/users' ) ) . toBe ( true ) ;
173180
174181 // Similar but different path should NOT be in scope (path boundary check)
182+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
175183 expect ( ( provider as any ) . _isWithinBasenameScope ( '/apps/my-app-other' ) ) . toBe ( false ) ;
184+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
176185 expect ( ( provider as any ) . _isWithinBasenameScope ( '/apps/my-app-other/users' ) ) . toBe ( false ) ;
177186
178187 // Completely different paths should NOT be in scope
188+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
179189 expect ( ( provider as any ) . _isWithinBasenameScope ( '/other' ) ) . toBe ( false ) ;
190+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
180191 expect ( ( provider as any ) . _isWithinBasenameScope ( '/' ) ) . toBe ( false ) ;
181192
182193 provider . dispose ( ) ;
@@ -189,7 +200,9 @@ describe('NavigationProvider', () => {
189200 } ) ;
190201
191202 // Pathname with consecutive slashes should be normalized
203+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
192204 expect ( ( provider as any ) . _isWithinBasenameScope ( '/apps//my-app' ) ) . toBe ( true ) ;
205+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
193206 expect ( ( provider as any ) . _isWithinBasenameScope ( '/apps/my-app//users' ) ) . toBe ( true ) ;
194207
195208 provider . dispose ( ) ;
@@ -205,11 +218,13 @@ describe('NavigationProvider', () => {
205218
206219 // Exact match should become '/'
207220 expect (
221+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
208222 ( provider as any ) . _localizePath ( { pathname : '/apps/my-app' , search : '' , hash : '' } ) ,
209223 ) . toEqual ( { pathname : '/' , search : '' , hash : '' } ) ;
210224
211225 // Path with basename prefix should have it stripped
212226 expect (
227+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
213228 ( provider as any ) . _localizePath ( {
214229 pathname : '/apps/my-app/users' ,
215230 search : '?q=test' ,
@@ -227,6 +242,7 @@ describe('NavigationProvider', () => {
227242 } ) ;
228243
229244 // Path that starts similarly but isn't a real match should not be stripped
245+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
230246 const result = ( provider as any ) . _localizePath ( {
231247 pathname : '/apps/my-app-other/users' ,
232248 search : '' ,
@@ -246,19 +262,22 @@ describe('NavigationProvider', () => {
246262 } ) ;
247263
248264 // With no basename, paths should be returned normalized
265+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
249266 expect ( ( provider as any ) . _localizePath ( { pathname : '/' , search : '' , hash : '' } ) ) . toEqual ( {
250267 pathname : '/' ,
251268 search : '' ,
252269 hash : '' ,
253270 } ) ;
254271
272+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
255273 expect ( ( provider as any ) . _localizePath ( { pathname : '/apps' , search : '' , hash : '' } ) ) . toEqual ( {
256274 pathname : '/apps' ,
257275 search : '' ,
258276 hash : '' ,
259277 } ) ;
260278
261279 expect (
280+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
262281 ( provider as any ) . _localizePath ( { pathname : '/apps/my-app' , search : '' , hash : '' } ) ,
263282 ) . toEqual ( { pathname : '/apps/my-app' , search : '' , hash : '' } ) ;
264283
@@ -273,6 +292,7 @@ describe('NavigationProvider', () => {
273292
274293 // Consecutive slashes should be collapsed
275294 expect (
295+ // biome-ignore lint/suspicious/noExplicitAny: Allow usage of 'any' in test files for mocking purposes
276296 ( provider as any ) . _localizePath ( { pathname : '/apps//my-app//users' , search : '' , hash : '' } ) ,
277297 ) . toEqual ( { pathname : '/users' , search : '' , hash : '' } ) ;
278298
0 commit comments