mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
[tests] fix dynamic routes end of array detection
This commit is contained in:
parent
a04a563f8d
commit
aeea3cb9eb
@ -21,7 +21,7 @@ test('Check .nuxt/router.js', t => {
|
|||||||
.slice(routerFile.indexOf('routes: ['))
|
.slice(routerFile.indexOf('routes: ['))
|
||||||
.replace('routes: [', '[')
|
.replace('routes: [', '[')
|
||||||
.replace(/ _[0-9A-z]+,/g, ' "",')
|
.replace(/ _[0-9A-z]+,/g, ' "",')
|
||||||
.replace('})', '')
|
routerFile = routerFile.substr(routerFile.indexOf('['), routerFile.lastIndexOf(']') + 1)
|
||||||
let routes = eval('( ' + routerFile + ')') // eslint-disable-line no-eval
|
let routes = eval('( ' + routerFile + ')') // eslint-disable-line no-eval
|
||||||
// pages/index.vue
|
// pages/index.vue
|
||||||
t.is(routes[0].path, '/')
|
t.is(routes[0].path, '/')
|
||||||
|
Loading…
Reference in New Issue
Block a user