mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +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
|
return resolvedPath
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.code === 'MODULE_NOT_FOUND') {
|
if (error.code !== 'MODULE_NOT_FOUND') {
|
||||||
// Continue to try other methods
|
|
||||||
} else {
|
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,14 @@ test.serial('Deprecated: dev in build.extend()', async t => {
|
|||||||
t.true(logSpy.calledWith('[build:done]: hook error'))
|
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
|
// Close server and ask nuxt to stop listening to file changes
|
||||||
test.after.always('Closing server and nuxt.js', async t => {
|
test.after.always('Closing server and nuxt.js', async t => {
|
||||||
await nuxt.close()
|
await nuxt.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user