mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 14:45:15 +00:00
test: update test and make index replacement case-insensitive
This commit is contained in:
parent
7db327cf9b
commit
db9cc66a3e
@ -6,7 +6,7 @@ export function getNameFromPath (path: string, relativeTo?: string) {
|
||||
const relativePath = relativeTo
|
||||
? normalize(path).replace(withTrailingSlash(normalize(relativeTo)), '')
|
||||
: basename(path)
|
||||
return kebabCase(relativePath.replace(/\/index\.\w+$/, '').replace(/[\\/]+/g, '-').replace(extname(relativePath), '')).replace(/["']/g, '')
|
||||
return kebabCase(relativePath.replace(/\/index\.\w+$/i, '').replace(/[\\/]+/g, '-').replace(extname(relativePath), '')).replace(/["']/g, '')
|
||||
}
|
||||
|
||||
export function hasSuffix (path: string, suffix: string) {
|
||||
|
@ -185,6 +185,7 @@ describe('resolveApp', () => {
|
||||
'layouts/default.vue',
|
||||
'layouts/some/layout.vue',
|
||||
'layouts/SomeOther.vue',
|
||||
'layouts/SomeOther/Thing/Index.vue',
|
||||
'layouts/some.vue',
|
||||
'layouts/SomeOther/layout.ts'
|
||||
])
|
||||
@ -210,6 +211,10 @@ describe('resolveApp', () => {
|
||||
"file": "<rootDir>/layouts/SomeOther/layout.ts",
|
||||
"name": "some-other-layout",
|
||||
},
|
||||
"some-other-thing": {
|
||||
"file": "<rootDir>/layouts/SomeOther/Thing/Index.vue",
|
||||
"name": "some-other-thing",
|
||||
},
|
||||
}
|
||||
`)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user