Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
fix: strip leading slash from app templates
Browse files Browse the repository at this point in the history
  • Loading branch information
pimlie committed Oct 10, 2019
1 parent 60a2b91 commit 0672b74
Show file tree
Hide file tree
Showing 3 changed files with 180 additions and 263 deletions.
2 changes: 1 addition & 1 deletion src/blueprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export default class Blueprint extends Module {
src,
// dst has blueprint id and app dir name added, remove those
// eg dst: blueprint/app/router.js -> router.js
fileName: dst.substr(dst.indexOf('app') + 3)
fileName: dst.substr(dst.indexOf('app') + 4)
})
}))
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/blueprint.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ describe('blueprint', () => {
expect(blueprint.addModule).toHaveBeenCalledTimes(1)
expect(blueprint.addModule).toHaveBeenCalledWith('/var/nuxt/my-blueprint-dir/modules/my-module.js')
expect(blueprint.addTemplate).toHaveBeenCalledTimes(5)
expect(blueprint.addTemplate).toHaveBeenCalledWith(expect.objectContaining({ src: 'app/empty.js' }))
expect(blueprint.addTemplate).toHaveBeenCalledWith(expect.objectContaining({ fileName: 'empty.js' }))

expect(consola.warn).toHaveBeenCalledTimes(1)
expect(consola.warn).toHaveBeenCalledWith(expect.stringContaining('Duplicate layout registration'))
Expand Down

0 comments on commit 0672b74

Please sign in to comment.