Skip to content

Commit

Permalink
test: add catchall path to route generation test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 19, 2023
1 parent 010b539 commit 71c3595
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
24 changes: 24 additions & 0 deletions packages/utils/test/__snapshots__/route.test.js.snap
Expand Up @@ -38,6 +38,12 @@ exports[`util: route util: route create createRoutes should allow snake case rou
"name": "subpage-param",
"path": "/subpage/:param?",
},
{
"chunkName": "pages/parent/_",
"component": "/some/nuxt/app/pages/parent/_.vue",
"name": "parent-all",
"path": "/parent/*",
},
{
"chunkName": "pages/index",
"component": "/some/nuxt/app/pages/index.vue",
Expand Down Expand Up @@ -162,6 +168,15 @@ exports[`util: route util: route create createRoutes should enforce trailing sla
"strict": true,
},
},
{
"chunkName": "pages/parent/_",
"component": "/some/nuxt/app/pages/parent/_.vue",
"name": "parent-all",
"path": "/parent/*",
"pathToRegexpOptions": {
"strict": true,
},
},
{
"chunkName": "pages/index",
"component": "/some/nuxt/app/pages/index.vue",
Expand Down Expand Up @@ -239,6 +254,15 @@ exports[`util: route util: route create createRoutes should remove trailing slas
"strict": true,
},
},
{
"chunkName": "pages/parent/_",
"component": "/some/nuxt/app/pages/parent/_.vue",
"name": "parent-all",
"path": "/parent/*",
"pathToRegexpOptions": {
"strict": true,
},
},
{
"chunkName": "pages/index",
"component": "/some/nuxt/app/pages/index.vue",
Expand Down
3 changes: 2 additions & 1 deletion packages/utils/test/route.test.js
Expand Up @@ -212,7 +212,8 @@ describe('util: route', () => {
'pages/another_route/_id.vue',
'pages/parent/index.vue',
'pages/parent/child/index.vue',
'pages/parent/child/test.vue'
'pages/parent/child/test.vue',
'pages/parent/_.vue'
]
const srcDir = '/some/nuxt/app'
const pagesDir = 'pages'
Expand Down

0 comments on commit 71c3595

Please sign in to comment.