From 15e206fd7bd9154df49ce9b783200bd464db000b Mon Sep 17 00:00:00 2001 From: benatespina Date: Tue, 19 Jun 2018 18:04:20 +0200 Subject: [PATCH] Fixed build --- .../languageStrategy/defaultUnprefixed.js | 216 ++++++++++-------- package.json | 2 +- 2 files changed, 125 insertions(+), 93 deletions(-) diff --git a/__tests__/languageStrategy/defaultUnprefixed.js b/__tests__/languageStrategy/defaultUnprefixed.js index 5b5bc4c..aadb09c 100644 --- a/__tests__/languageStrategy/defaultUnprefixed.js +++ b/__tests__/languageStrategy/defaultUnprefixed.js @@ -165,40 +165,46 @@ test('Generates valid react-router-config deeply nested tree', () => { }, component: DummyComponent, exact: false, - routes: [{ - paths: { - en: '/product/:slug/edit', - es: '/producto/:slug/editar', - eu: '/produktua/:slug/aldatu', - }, - component: DummyComponent, - exact: true, - }, { - paths: { - en: '/product/:slug/view', - es: '/producto/:slug/ver', - eu: '/produktua/:slug/ikusi', - }, - component: DummyComponent, - exact: true, - }, { - paths: { - en: '/product/:slug/comments/:comment', - es: '/producto/:slug/comentarios/:comment', - eu: '/produktua/:slug/iruzkinak/:comment', + routes: [ + { + paths: { + en: '/product/:slug/edit', + es: '/producto/:slug/editar', + eu: '/produktua/:slug/aldatu', + }, + component: DummyComponent, + exact: true, }, - component: DummyComponent, - exact: false, - routes: [{ + { paths: { - en: '/product/:slug/comments/:comment/edit', - es: '/producto/:slug/comentarios/:comment/editar', - eu: '/produktua/:slug/iruzkinak/:comment/aldatu', + en: '/product/:slug/view', + es: '/producto/:slug/ver', + eu: '/produktua/:slug/ikusi', }, component: DummyComponent, exact: true, - }], - }], + }, + { + paths: { + en: '/product/:slug/comments/:comment', + es: '/producto/:slug/comentarios/:comment', + eu: '/produktua/:slug/iruzkinak/:comment', + }, + component: DummyComponent, + exact: false, + routes: [ + { + paths: { + en: '/product/:slug/comments/:comment/edit', + es: '/producto/:slug/comentarios/:comment/editar', + eu: '/produktua/:slug/iruzkinak/:comment/aldatu', + }, + component: DummyComponent, + exact: true, + }, + ], + }, + ], }, ], }, @@ -213,70 +219,88 @@ test('Generates valid react-router-config deeply nested tree', () => { path: '/product/:slug', component: DummyComponent, exact: false, - routes: [{ - path: '/product/:slug/edit', - component: DummyComponent, - exact: true, - }, { - path: '/product/:slug/view', - component: DummyComponent, - exact: true, - }, { - path: '/product/:slug/comments/:comment', - component: DummyComponent, - exact: false, - routes: [{ - path: '/product/:slug/comments/:comment/edit', + routes: [ + { + path: '/product/:slug/edit', + component: DummyComponent, + exact: true, + }, + { + path: '/product/:slug/view', component: DummyComponent, exact: true, - }], - }], + }, + { + path: '/product/:slug/comments/:comment', + component: DummyComponent, + exact: false, + routes: [ + { + path: '/product/:slug/comments/:comment/edit', + component: DummyComponent, + exact: true, + }, + ], + }, + ], }, { path: '/es/producto/:slug', component: DummyComponent, exact: false, - routes: [{ - path: '/es/producto/:slug/editar', - component: DummyComponent, - exact: true, - }, { - path: '/es/producto/:slug/ver', - component: DummyComponent, - exact: true, - }, { - path: '/es/producto/:slug/comentarios/:comment', - component: DummyComponent, - exact: false, - routes: [{ - path: '/es/producto/:slug/comentarios/:comment/editar', + routes: [ + { + path: '/es/producto/:slug/editar', + component: DummyComponent, + exact: true, + }, + { + path: '/es/producto/:slug/ver', component: DummyComponent, exact: true, - }], - }], + }, + { + path: '/es/producto/:slug/comentarios/:comment', + component: DummyComponent, + exact: false, + routes: [ + { + path: '/es/producto/:slug/comentarios/:comment/editar', + component: DummyComponent, + exact: true, + }, + ], + }, + ], }, { path: '/eu/produktua/:slug', component: DummyComponent, exact: false, - routes: [{ - path: '/eu/produktua/:slug/aldatu', - component: DummyComponent, - exact: true, - }, { - path: '/eu/produktua/:slug/ikusi', - component: DummyComponent, - exact: true, - }, { - path: '/eu/produktua/:slug/iruzkinak/:comment', - component: DummyComponent, - exact: false, - routes: [{ - path: '/eu/produktua/:slug/iruzkinak/:comment/aldatu', + routes: [ + { + path: '/eu/produktua/:slug/aldatu', + component: DummyComponent, + exact: true, + }, + { + path: '/eu/produktua/:slug/ikusi', component: DummyComponent, exact: true, - }], - }], + }, + { + path: '/eu/produktua/:slug/iruzkinak/:comment', + component: DummyComponent, + exact: false, + routes: [ + { + path: '/eu/produktua/:slug/iruzkinak/:comment/aldatu', + component: DummyComponent, + exact: true, + }, + ], + }, + ], }, ], }, @@ -291,13 +315,15 @@ test('Generates valid react-router-config complex nested tree', () => { routes: [ { paths: '/', - routes: [{ - paths: { - en: '/en-test', - es: '/es-test', - eu: '/eu-test', + routes: [ + { + paths: { + en: '/en-test', + es: '/es-test', + eu: '/eu-test', + }, }, - }], + ], }, { paths: { @@ -327,21 +353,27 @@ test('Generates valid react-router-config complex nested tree', () => { routes: [ { path: '/', - routes: [{ - path: '/en-test', - }], + routes: [ + { + path: '/en-test', + }, + ], }, { path: '/es/', - routes: [{ - path: '/es/es-test', - }], + routes: [ + { + path: '/es/es-test', + }, + ], }, { path: '/eu/', - routes: [{ - path: '/eu/eu-test', - }], + routes: [ + { + path: '/eu/eu-test', + }, + ], }, {path: '/cart'}, {path: '/es/carrito'}, diff --git a/package.json b/package.json index 423db7d..cebbba1 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "common-bundle": "node_modules/.bin/babel --copy-files --out-dir dist/common src", "esm-bundle": "cp -R src dist/esm", "cs": "npm run eslint && npm run prettier", - "prettier": "node_modules/.bin/prettier 'tests/**/*.js' 'src/**/*.js' --write --single-quote --no-bracket-spacing --trailing-comma all", + "prettier": "node_modules/.bin/prettier '__tests__/**/*.js' 'src/**/*.js' --write --single-quote --no-bracket-spacing --trailing-comma all", "eslint": "node_modules/.bin/eslint src/**/*.js __tests__/**/*.js" }, "files": [