@@ -1315,6 +1315,8 @@ Deno.test("fsRoutes - sortRoutePaths with groups", () => {
13151315
13161316 routes = [
13171317 "/_app" ,
1318+ "/app" ,
1319+ "/app/_middleware" ,
13181320 "/(authed)/_middleware" ,
13191321 "/(authed)/_layout" ,
13201322 "/_error" ,
@@ -1325,26 +1327,71 @@ Deno.test("fsRoutes - sortRoutePaths with groups", () => {
13251327 "/(authed)/(account)/account" ,
13261328 "/(authed)/api/slug" ,
13271329 "/hooks/github" ,
1330+ "/(authed)/[org]/__foo" ,
13281331 "/(authed)/[org]/_middleware" ,
13291332 "/(authed)/[org]/index" ,
13301333 ] ;
1334+ routes . sort ( ( ) => Math . random ( ) > 0.5 ? - 1 : 1 ) ;
13311335 routes . sort ( sortRoutePaths ) ;
13321336 sorted = [
13331337 "/_app" ,
13341338 "/_error" ,
1335- "/login" ,
1339+ "/app/_middleware" ,
1340+ "/app" ,
13361341 "/auth/login" ,
13371342 "/auth/logout" ,
13381343 "/hooks/github" ,
1344+ "/login" ,
13391345 "/(authed)/_middleware" ,
13401346 "/(authed)/_layout" ,
13411347 "/(authed)/index" ,
13421348 "/(authed)/api/slug" ,
13431349 "/(authed)/(account)/account" ,
13441350 "/(authed)/[org]/_middleware" ,
1351+ "/(authed)/[org]/__foo" ,
13451352 "/(authed)/[org]/index" ,
13461353 ] ;
13471354 expect ( routes ) . toEqual ( sorted ) ;
1355+
1356+ routes = [
1357+ "/_app.js" ,
1358+ "/app.tsx" ,
1359+ "/app/_middleware.tsx" ,
1360+ "/(authed)/_middleware.tsx" ,
1361+ "/(authed)/_layout.jsx" ,
1362+ "/_error.tsx" ,
1363+ "/(authed)/index.js" ,
1364+ "/login.js" ,
1365+ "/auth/logout.tsx" ,
1366+ "/auth/login.ts" ,
1367+ "/(authed)/(account)/account.tsx" ,
1368+ "/(authed)/api/slug.js" ,
1369+ "/hooks/github.js" ,
1370+ "/(authed)/[org]/__foo.js" ,
1371+ "/(authed)/[org]/_middleware.tsx" ,
1372+ "/(authed)/[org]/index.ts" ,
1373+ ] ;
1374+ routes . sort ( ( ) => Math . random ( ) > 0.5 ? - 1 : 1 ) ;
1375+ routes . sort ( sortRoutePaths ) ;
1376+ sorted = [
1377+ "/_app.js" ,
1378+ "/_error.tsx" ,
1379+ "/app/_middleware.tsx" ,
1380+ "/app.tsx" ,
1381+ "/auth/login.ts" ,
1382+ "/auth/logout.tsx" ,
1383+ "/hooks/github.js" ,
1384+ "/login.js" ,
1385+ "/(authed)/_middleware.tsx" ,
1386+ "/(authed)/_layout.jsx" ,
1387+ "/(authed)/index.js" ,
1388+ "/(authed)/api/slug.js" ,
1389+ "/(authed)/(account)/account.tsx" ,
1390+ "/(authed)/[org]/_middleware.tsx" ,
1391+ "/(authed)/[org]/__foo.js" ,
1392+ "/(authed)/[org]/index.ts" ,
1393+ ] ;
1394+ expect ( routes ) . toEqual ( sorted ) ;
13481395} ) ;
13491396
13501397Deno . test ( "fsRoutes - registers default GET route for component without GET handler" , async ( ) => {
0 commit comments