mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
382 lines
9.7 KiB
Plaintext
382 lines
9.7 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`util: route util: route create createRoutes should allow snake case routes in posix system 1`] = `
|
|
[
|
|
{
|
|
"chunkName": "pages/parent/index",
|
|
"component": "/some/nuxt/app/pages/parent/index.vue",
|
|
"name": "parent",
|
|
"path": "/parent",
|
|
},
|
|
{
|
|
"chunkName": "pages/snake_case_route",
|
|
"component": "/some/nuxt/app/pages/snake_case_route.vue",
|
|
"name": "snake_case_route",
|
|
"path": "/snake_case_route",
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/child/index",
|
|
"component": "/some/nuxt/app/pages/parent/child/index.vue",
|
|
"name": "parent-child",
|
|
"path": "/parent/child",
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/child/test",
|
|
"component": "/some/nuxt/app/pages/parent/child/test.vue",
|
|
"name": "parent-child-test",
|
|
"path": "/parent/child/test",
|
|
},
|
|
{
|
|
"chunkName": "pages/index",
|
|
"component": "/some/nuxt/app/pages/index.vue",
|
|
"name": "index",
|
|
"path": "/",
|
|
},
|
|
{
|
|
"chunkName": "pages/another_route/_id",
|
|
"component": "/some/nuxt/app/pages/another_route/_id.vue",
|
|
"name": "another_route-id",
|
|
"path": "/another_route/:id?",
|
|
},
|
|
{
|
|
"chunkName": "pages/subpage/_param",
|
|
"component": "/some/nuxt/app/pages/subpage/_param.vue",
|
|
"name": "subpage-param",
|
|
"path": "/subpage/:param?",
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/_",
|
|
"component": "/some/nuxt/app/pages/parent/_.vue",
|
|
"name": "parent-all",
|
|
"path": "/parent/*",
|
|
},
|
|
{
|
|
"chunkName": "pages/_param",
|
|
"component": "/some/nuxt/app/pages/_param.vue",
|
|
"name": "param",
|
|
"path": "/:param",
|
|
},
|
|
]
|
|
`;
|
|
|
|
exports[`util: route util: route create createRoutes should allow snake case routes in windows system 1`] = `
|
|
[
|
|
{
|
|
"chunkName": "pages/parent/index",
|
|
"component": "\\\\\\\\some\\\\nuxt\\\\app\\\\pages\\\\parent\\\\index.vue",
|
|
"name": "parent",
|
|
"path": "/parent",
|
|
},
|
|
{
|
|
"chunkName": "pages/snake_case_route",
|
|
"component": "\\\\\\\\some\\\\nuxt\\\\app\\\\pages\\\\snake_case_route.vue",
|
|
"name": "snake_case_route",
|
|
"path": "/snake_case_route",
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/child/index",
|
|
"component": "\\\\\\\\some\\\\nuxt\\\\app\\\\pages\\\\parent\\\\child\\\\index.vue",
|
|
"name": "parent-child",
|
|
"path": "/parent/child",
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/child/test",
|
|
"component": "\\\\\\\\some\\\\nuxt\\\\app\\\\pages\\\\parent\\\\child\\\\test.vue",
|
|
"name": "parent-child-test",
|
|
"path": "/parent/child/test",
|
|
},
|
|
{
|
|
"chunkName": "pages/index",
|
|
"component": "\\\\\\\\some\\\\nuxt\\\\app\\\\pages\\\\index.vue",
|
|
"name": "index",
|
|
"path": "/",
|
|
},
|
|
{
|
|
"chunkName": "pages/another_route/_id",
|
|
"component": "\\\\\\\\some\\\\nuxt\\\\app\\\\pages\\\\another_route\\\\_id.vue",
|
|
"name": "another_route-id",
|
|
"path": "/another_route/:id?",
|
|
},
|
|
{
|
|
"chunkName": "pages/subpage/_param",
|
|
"component": "\\\\\\\\some\\\\nuxt\\\\app\\\\pages\\\\subpage\\\\_param.vue",
|
|
"name": "subpage-param",
|
|
"path": "/subpage/:param?",
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/_",
|
|
"component": "\\\\\\\\some\\\\nuxt\\\\app\\\\pages\\\\parent\\\\_.vue",
|
|
"name": "parent-all",
|
|
"path": "/parent/*",
|
|
},
|
|
{
|
|
"chunkName": "pages/_param",
|
|
"component": "\\\\\\\\some\\\\nuxt\\\\app\\\\pages\\\\_param.vue",
|
|
"name": "param",
|
|
"path": "/:param",
|
|
},
|
|
]
|
|
`;
|
|
|
|
exports[`util: route util: route create createRoutes should enforce trailing slashes when configured to 1`] = `
|
|
[
|
|
{
|
|
"chunkName": "pages/parent/index",
|
|
"component": "/some/nuxt/app/pages/parent/index.vue",
|
|
"name": "parent",
|
|
"path": "/parent/",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/snake_case_route",
|
|
"component": "/some/nuxt/app/pages/snake_case_route.vue",
|
|
"name": "snake_case_route",
|
|
"path": "/snake_case_route/",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/child/index",
|
|
"component": "/some/nuxt/app/pages/parent/child/index.vue",
|
|
"name": "parent-child",
|
|
"path": "/parent/child/",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/child/test",
|
|
"component": "/some/nuxt/app/pages/parent/child/test.vue",
|
|
"name": "parent-child-test",
|
|
"path": "/parent/child/test/",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/index",
|
|
"component": "/some/nuxt/app/pages/index.vue",
|
|
"name": "index",
|
|
"path": "/",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/another_route/_id",
|
|
"component": "/some/nuxt/app/pages/another_route/_id.vue",
|
|
"name": "another_route-id",
|
|
"path": "/another_route/:id?/",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/subpage/_param",
|
|
"component": "/some/nuxt/app/pages/subpage/_param.vue",
|
|
"name": "subpage-param",
|
|
"path": "/subpage/:param?/",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/_",
|
|
"component": "/some/nuxt/app/pages/parent/_.vue",
|
|
"name": "parent-all",
|
|
"path": "/parent/*",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/_param",
|
|
"component": "/some/nuxt/app/pages/_param.vue",
|
|
"name": "param",
|
|
"path": "/:param/",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
]
|
|
`;
|
|
|
|
exports[`util: route util: route create createRoutes should remove trailing slashes when configured to 1`] = `
|
|
[
|
|
{
|
|
"chunkName": "pages/parent/index",
|
|
"component": "/some/nuxt/app/pages/parent/index.vue",
|
|
"name": "parent",
|
|
"path": "/parent",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/snake_case_route",
|
|
"component": "/some/nuxt/app/pages/snake_case_route.vue",
|
|
"name": "snake_case_route",
|
|
"path": "/snake_case_route",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/child/index",
|
|
"component": "/some/nuxt/app/pages/parent/child/index.vue",
|
|
"name": "parent-child",
|
|
"path": "/parent/child",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/child/test",
|
|
"component": "/some/nuxt/app/pages/parent/child/test.vue",
|
|
"name": "parent-child-test",
|
|
"path": "/parent/child/test",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/index",
|
|
"component": "/some/nuxt/app/pages/index.vue",
|
|
"name": "index",
|
|
"path": "/",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/another_route/_id",
|
|
"component": "/some/nuxt/app/pages/another_route/_id.vue",
|
|
"name": "another_route-id",
|
|
"path": "/another_route/:id?",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/subpage/_param",
|
|
"component": "/some/nuxt/app/pages/subpage/_param.vue",
|
|
"name": "subpage-param",
|
|
"path": "/subpage/:param?",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/_",
|
|
"component": "/some/nuxt/app/pages/parent/_.vue",
|
|
"name": "parent-all",
|
|
"path": "/parent/*",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
{
|
|
"chunkName": "pages/_param",
|
|
"component": "/some/nuxt/app/pages/_param.vue",
|
|
"name": "param",
|
|
"path": "/:param",
|
|
"pathToRegexpOptions": {
|
|
"strict": true,
|
|
},
|
|
},
|
|
]
|
|
`;
|
|
|
|
exports[`util: route util: route sortRoutes sortRoutes should sort routes 1`] = `
|
|
[
|
|
{
|
|
"chunkName": "pages/de/index",
|
|
"component": "/some/nuxt/app/pages/de/index.vue",
|
|
"name": "de",
|
|
"path": "/de",
|
|
},
|
|
{
|
|
"chunkName": "pages/de_",
|
|
"component": "/some/nuxt/app/pages/de_.vue",
|
|
"name": "de_",
|
|
"path": "/de_",
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/index",
|
|
"component": "/some/nuxt/app/pages/parent/index.vue",
|
|
"name": "parent",
|
|
"path": "/parent",
|
|
},
|
|
{
|
|
"chunkName": "pages/snake_case_route",
|
|
"component": "/some/nuxt/app/pages/snake_case_route.vue",
|
|
"name": "snake_case_route",
|
|
"path": "/snake_case_route",
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"chunkName": "pages/another_route/rout_",
|
|
"component": "/some/nuxt/app/pages/another_route/rout_.vue",
|
|
"name": "another_route-rout_",
|
|
"path": "",
|
|
},
|
|
],
|
|
"chunkName": "pages/another_route/rout_",
|
|
"component": "/some/nuxt/app/pages/another_route/rout_.vue",
|
|
"path": "/another_route/rout_",
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/child/index",
|
|
"component": "/some/nuxt/app/pages/parent/child/index.vue",
|
|
"name": "parent-child",
|
|
"path": "/parent/child",
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/child/test",
|
|
"component": "/some/nuxt/app/pages/parent/child/test.vue",
|
|
"name": "parent-child-test",
|
|
"path": "/parent/child/test",
|
|
},
|
|
{
|
|
"chunkName": "pages/index",
|
|
"component": "/some/nuxt/app/pages/index.vue",
|
|
"name": "index",
|
|
"path": "/",
|
|
},
|
|
{
|
|
"chunkName": "pages/another_route/_id",
|
|
"component": "/some/nuxt/app/pages/another_route/_id.vue",
|
|
"name": "another_route-id",
|
|
"path": "/another_route/:id?",
|
|
},
|
|
{
|
|
"chunkName": "pages/subpage/_param",
|
|
"component": "/some/nuxt/app/pages/subpage/_param.vue",
|
|
"name": "subpage-param",
|
|
"path": "/subpage/:param?",
|
|
},
|
|
{
|
|
"chunkName": "pages/parent/_",
|
|
"component": "/some/nuxt/app/pages/parent/_.vue",
|
|
"name": "parent-all",
|
|
"path": "/parent/*",
|
|
},
|
|
{
|
|
"chunkName": "pages/_param",
|
|
"component": "/some/nuxt/app/pages/_param.vue",
|
|
"name": "param",
|
|
"path": "/:param",
|
|
},
|
|
{
|
|
"chunkName": "pages/_",
|
|
"component": "/some/nuxt/app/pages/_.vue",
|
|
"name": "all",
|
|
"path": "/*",
|
|
},
|
|
]
|
|
`;
|