From 71c3595169c6c2979d80e9ca1e1b0a10299ed21d Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 19 May 2023 11:37:14 +0100 Subject: [PATCH] test: add catchall path to route generation test --- .../test/__snapshots__/route.test.js.snap | 24 +++++++++++++++++++ packages/utils/test/route.test.js | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/packages/utils/test/__snapshots__/route.test.js.snap b/packages/utils/test/__snapshots__/route.test.js.snap index ed3c53e388..fc0b32c2d1 100644 --- a/packages/utils/test/__snapshots__/route.test.js.snap +++ b/packages/utils/test/__snapshots__/route.test.js.snap @@ -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", @@ -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", @@ -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", diff --git a/packages/utils/test/route.test.js b/packages/utils/test/route.test.js index 10982b2a8c..9aee50ff0a 100644 --- a/packages/utils/test/route.test.js +++ b/packages/utils/test/route.test.js @@ -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'