Nuxt/packages/utils/test/__snapshots__/route.test.js.snap

298 lines
8.3 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`] = `
Array [
Object {
"chunkName": "pages/parent/index",
"component": "/some/nuxt/app/pages/parent/index.vue",
"name": "parent",
"path": "/parent",
},
Object {
"chunkName": "pages/snake_case_route",
"component": "/some/nuxt/app/pages/snake_case_route.vue",
"name": "snake_case_route",
"path": "/snake_case_route",
},
Object {
"chunkName": "pages/parent/child/index",
"component": "/some/nuxt/app/pages/parent/child/index.vue",
"name": "parent-child",
"path": "/parent/child",
},
Object {
"chunkName": "pages/parent/child/test",
"component": "/some/nuxt/app/pages/parent/child/test.vue",
"name": "parent-child-test",
"path": "/parent/child/test",
},
Object {
"children": Array [
Object {
"chunkName": "pages/another_route/_id",
"component": "/some/nuxt/app/pages/another_route/_id.vue",
"name": "another_route-id",
"path": "",
},
],
"chunkName": "pages/another_route/_id",
"component": "/some/nuxt/app/pages/another_route/_id.vue",
"path": "/another_route/:id?",
},
Object {
"chunkName": "pages/subpage/_param",
"component": "/some/nuxt/app/pages/subpage/_param.vue",
"name": "subpage-param",
"path": "/subpage/:param?",
},
Object {
"chunkName": "pages/index",
"component": "/some/nuxt/app/pages/index.vue",
"name": "index",
"path": "/",
},
Object {
"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`] = `
Array [
Object {
"chunkName": "pages/parent/index",
"component": "\\\\\\\\\\\\\\\\some\\\\\\\\nuxt\\\\\\\\app\\\\\\\\pages\\\\\\\\parent\\\\\\\\index.vue",
"name": "parent",
"path": "/parent",
},
Object {
"chunkName": "pages/snake_case_route",
"component": "\\\\\\\\\\\\\\\\some\\\\\\\\nuxt\\\\\\\\app\\\\\\\\pages\\\\\\\\snake_case_route.vue",
"name": "snake_case_route",
"path": "/snake_case_route",
},
Object {
"chunkName": "pages/parent/child/index",
"component": "\\\\\\\\\\\\\\\\some\\\\\\\\nuxt\\\\\\\\app\\\\\\\\pages\\\\\\\\parent\\\\\\\\child\\\\\\\\index.vue",
"name": "parent-child",
"path": "/parent/child",
},
Object {
"chunkName": "pages/parent/child/test",
"component": "\\\\\\\\\\\\\\\\some\\\\\\\\nuxt\\\\\\\\app\\\\\\\\pages\\\\\\\\parent\\\\\\\\child\\\\\\\\test.vue",
"name": "parent-child-test",
"path": "/parent/child/test",
},
Object {
"children": Array [
Object {
"chunkName": "pages/another_route/_id",
"component": "\\\\\\\\\\\\\\\\some\\\\\\\\nuxt\\\\\\\\app\\\\\\\\pages\\\\\\\\another_route\\\\\\\\_id.vue",
"name": "another_route-id",
"path": "",
},
],
"chunkName": "pages/another_route/_id",
"component": "\\\\\\\\\\\\\\\\some\\\\\\\\nuxt\\\\\\\\app\\\\\\\\pages\\\\\\\\another_route\\\\\\\\_id.vue",
"path": "/another_route/:id?",
},
Object {
"chunkName": "pages/subpage/_param",
"component": "\\\\\\\\\\\\\\\\some\\\\\\\\nuxt\\\\\\\\app\\\\\\\\pages\\\\\\\\subpage\\\\\\\\_param.vue",
"name": "subpage-param",
"path": "/subpage/:param?",
},
Object {
"chunkName": "pages/index",
"component": "\\\\\\\\\\\\\\\\some\\\\\\\\nuxt\\\\\\\\app\\\\\\\\pages\\\\\\\\index.vue",
"name": "index",
"path": "/",
},
Object {
"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`] = `
Array [
Object {
"chunkName": "pages/parent/index",
"component": "/some/nuxt/app/pages/parent/index.vue",
"name": "parent",
"path": "/parent/",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/snake_case_route",
"component": "/some/nuxt/app/pages/snake_case_route.vue",
"name": "snake_case_route",
"path": "/snake_case_route/",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/parent/child/index",
"component": "/some/nuxt/app/pages/parent/child/index.vue",
"name": "parent-child",
"path": "/parent/child/",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/parent/child/test",
"component": "/some/nuxt/app/pages/parent/child/test.vue",
"name": "parent-child-test",
"path": "/parent/child/test/",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"children": Array [
Object {
"chunkName": "pages/another_route/_id",
"component": "/some/nuxt/app/pages/another_route/_id.vue",
"name": "another_route-id",
"path": "",
"pathToRegexpOptions": Object {
"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": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/subpage/_param",
"component": "/some/nuxt/app/pages/subpage/_param.vue",
"name": "subpage-param",
"path": "/subpage/:param?/",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/index",
"component": "/some/nuxt/app/pages/index.vue",
"name": "index",
"path": "/",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/_param",
"component": "/some/nuxt/app/pages/_param.vue",
"name": "param",
"path": "/:param/",
"pathToRegexpOptions": Object {
"strict": true,
},
},
]
`;
exports[`util: route util: route create createRoutes should remove trailing slashes when configured to 1`] = `
Array [
Object {
"chunkName": "pages/parent/index",
"component": "/some/nuxt/app/pages/parent/index.vue",
"name": "parent",
"path": "/parent",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/snake_case_route",
"component": "/some/nuxt/app/pages/snake_case_route.vue",
"name": "snake_case_route",
"path": "/snake_case_route",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/parent/child/index",
"component": "/some/nuxt/app/pages/parent/child/index.vue",
"name": "parent-child",
"path": "/parent/child",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/parent/child/test",
"component": "/some/nuxt/app/pages/parent/child/test.vue",
"name": "parent-child-test",
"path": "/parent/child/test",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"children": Array [
Object {
"chunkName": "pages/another_route/_id",
"component": "/some/nuxt/app/pages/another_route/_id.vue",
"name": "another_route-id",
"path": "",
"pathToRegexpOptions": Object {
"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": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/subpage/_param",
"component": "/some/nuxt/app/pages/subpage/_param.vue",
"name": "subpage-param",
"path": "/subpage/:param?",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/index",
"component": "/some/nuxt/app/pages/index.vue",
"name": "index",
"path": "/",
"pathToRegexpOptions": Object {
"strict": true,
},
},
Object {
"chunkName": "pages/_param",
"component": "/some/nuxt/app/pages/_param.vue",
"name": "param",
"path": "/:param",
"pathToRegexpOptions": Object {
"strict": true,
},
},
]
`;