File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,12 @@ export default class Router {
406
406
) ;
407
407
}
408
408
409
+ if ( 'sticky' in options ) {
410
+ throw new Error (
411
+ `Altering the stickiness of route \`${ routeName } \` is not supported` ,
412
+ ) ;
413
+ }
414
+
409
415
const newConfig = { ...route . config , ...options } ;
410
416
Object . entries ( options ) . forEach ( ( [ key , value ] ) => {
411
417
if ( value === null ) {
Original file line number Diff line number Diff line change @@ -342,6 +342,15 @@ describe('Routing', () => {
342
342
'Cannot rename the route `named` as `new name`: renaming routes is not supported' ,
343
343
) ;
344
344
} ) ;
345
+
346
+ it ( "errors when trying to alter a route's stickiness" , ( ) => {
347
+ fm . route ( 'http://a.com/' , 200 , { name : 'named' } ) ;
348
+ expect ( ( ) =>
349
+ fm . modifyRoute ( 'named' , {
350
+ sticky : true ,
351
+ } ) ,
352
+ ) . toThrow ( 'Altering the stickiness of route `named` is not supported' ) ;
353
+ } ) ;
345
354
} ) ;
346
355
describe ( 'removeRoute' , ( ) => {
347
356
testChainableMethod ( `removeRoute` ) ;
You can’t perform that action at this time.
0 commit comments