diff --git a/src/helpers/components.js b/src/helpers/components.js index d2bf6c614..d7facc942 100644 --- a/src/helpers/components.js +++ b/src/helpers/components.js @@ -11,7 +11,7 @@ const compiler = require('vue-template-compiler') exports.extractComponentOptions = (path) => { let componentOptions = {} - let Component = compiler.parseComponent(readFileSync(path).toString()) + const Component = compiler.parseComponent(readFileSync(path).toString()) if (!Component.script || Component.script.content.length < 1) { return componentOptions } diff --git a/src/helpers/routes.js b/src/helpers/routes.js index a907261d5..c8116a947 100644 --- a/src/helpers/routes.js +++ b/src/helpers/routes.js @@ -55,7 +55,8 @@ exports.makeRoutes = (baseRoutes, { // Generate routes for component's supported locales for (let i = 0, length1 = componentOptions.locales.length; i < length1; i++) { const locale = componentOptions.locales[i] - let { name, path } = route + const { name } = route + let { path } = route const localizedRoute = { ...route } // Skip if locale not in module's configuration diff --git a/test/fixtures/basic/module.test.js b/test/fixtures/basic/module.test.js index 67eeedd50..4ca2754b4 100644 --- a/test/fixtures/basic/module.test.js +++ b/test/fixtures/basic/module.test.js @@ -34,27 +34,27 @@ describe('basic', () => { }) test('/ contains EN text, link to /fr/ & link /about-us', async () => { - let html = await get('/') + const html = await get('/') expect(cleanUpScripts(html)).toMatchSnapshot() }) test('/fr contains FR text, link to / & link to /fr/a-propos', async () => { - let html = await get('/fr') + const html = await get('/fr') expect(cleanUpScripts(html)).toMatchSnapshot() }) test('/about-us contains EN text, link to /fr/a-propos & link /', async () => { - let html = await get('/about-us') + const html = await get('/about-us') expect(cleanUpScripts(html)).toMatchSnapshot() }) test('/fr/a-propos contains FR text, link to /about-us & link to /fr/', async () => { - let html = await get('/fr/a-propos') + const html = await get('/fr/a-propos') expect(cleanUpScripts(html)).toMatchSnapshot() }) test('/fr/notlocalized contains FR text', async () => { - let html = await get('/fr/notlocalized') + const html = await get('/fr/notlocalized') expect(cleanUpScripts(html)).toMatchSnapshot() }) @@ -75,32 +75,32 @@ describe('basic', () => { }) test('/posts contains EN text, link to /fr/posts/ & link to /posts/my-slug', async () => { - let html = await get('/posts') + const html = await get('/posts') expect(cleanUpScripts(html)).toMatchSnapshot() }) test('/posts/my-slug contains EN text, post\'s slug, link to /fr/posts/my-slug & link to /posts/', async () => { - let html = await get('/posts/my-slug') + const html = await get('/posts/my-slug') expect(cleanUpScripts(html)).toMatchSnapshot() }) test('/fr/posts contains FR text, link to /posts/ & link to /fr/posts/my-slug', async () => { - let html = await get('/fr/posts') + const html = await get('/fr/posts') expect(cleanUpScripts(html)).toMatchSnapshot() }) test('/fr/posts/my-slug contains FR text, post\'s slug, link to /posts/my-slug & link to /fr/posts/', async () => { - let html = await get('/fr/posts/my-slug') + const html = await get('/fr/posts/my-slug') expect(cleanUpScripts(html)).toMatchSnapshot() }) test('/dynamicNested/1/2/3 contains link to /fr/imbrication-dynamique/1/2/3', async () => { - let html = await get('/dynamicNested/1/2/3') + const html = await get('/dynamicNested/1/2/3') expect(cleanUpScripts(html)).toMatchSnapshot() }) test('/fr/imbrication-dynamique/1/2/3 contains link to /dynamicNested/1/2/3', async () => { - let html = await get('/fr/imbrication-dynamique/1/2/3') + const html = await get('/fr/imbrication-dynamique/1/2/3') expect(cleanUpScripts(html)).toMatchSnapshot() }) })