Skip to content

Commit

Permalink
style: Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgv committed Jul 10, 2019
1 parent bb67856 commit fe962e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/helpers/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion src/helpers/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions test/fixtures/basic/module.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})

Expand All @@ -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()
})
})

0 comments on commit fe962e3

Please sign in to comment.