mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
test: resolvePath throws error
This commit is contained in:
parent
a2ac4cb331
commit
4907e81574
@ -200,9 +200,7 @@ module.exports = class Nuxt {
|
||||
})
|
||||
return resolvedPath
|
||||
} catch (error) {
|
||||
if (error.code === 'MODULE_NOT_FOUND') {
|
||||
// Continue to try other methods
|
||||
} else {
|
||||
if (error.code !== 'MODULE_NOT_FOUND') {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
@ -78,6 +78,14 @@ test.serial('Deprecated: dev in build.extend()', async t => {
|
||||
t.true(logSpy.calledWith('[build:done]: hook error'))
|
||||
})
|
||||
|
||||
test.serial('Error: resolvePath()', async t => {
|
||||
let error = t.throws(() => nuxt.resolvePath())
|
||||
t.true(error instanceof TypeError)
|
||||
|
||||
error = t.throws(() => nuxt.resolvePath('@/pages/about.vue'))
|
||||
t.true(error.message.includes('Cannot resolve "@/pages/about.vue"'))
|
||||
})
|
||||
|
||||
// Close server and ask nuxt to stop listening to file changes
|
||||
test.after.always('Closing server and nuxt.js', async t => {
|
||||
await nuxt.close()
|
||||
|
Loading…
Reference in New Issue
Block a user