mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
test: youch without source-map and access publicPath in spa
This commit is contained in:
parent
4cafca0fec
commit
652c3d63d1
@ -38,6 +38,19 @@ test('/test/error should return error stack trace (Youch)', async t => {
|
||||
t.true(error.includes('<div class="error-frames">'))
|
||||
})
|
||||
|
||||
test('/test/error no source-map (Youch)', async t => {
|
||||
const sourceMaps = nuxt.renderer.resources.serverBundle.maps
|
||||
nuxt.renderer.resources.serverBundle.maps = {}
|
||||
|
||||
const { response, error } = await t.throws(nuxt.renderAndGetWindow(url('/test/error')))
|
||||
t.is(response.statusCode, 500)
|
||||
t.is(response.statusMessage, 'NuxtServerError')
|
||||
t.true(error.includes('test youch !'))
|
||||
t.true(error.includes('<div class="error-frames">'))
|
||||
|
||||
nuxt.renderer.resources.serverBundle.maps = sourceMaps
|
||||
})
|
||||
|
||||
test('/test/error should return json format error (Youch)', async t => {
|
||||
const opts = {
|
||||
headers: {
|
||||
|
@ -47,6 +47,12 @@ test('/custom (call mounted and created once)', async t => {
|
||||
t.true(mounts.length === 1)
|
||||
})
|
||||
|
||||
test('/_nuxt/ (access publicPath in spa mode)', async t => {
|
||||
const { response: { statusCode, statusMessage } } = await t.throws(renderRoute('/_nuxt/'))
|
||||
t.is(statusCode, 404)
|
||||
t.is(statusMessage, 'ResourceNotFound')
|
||||
})
|
||||
|
||||
// Close server and ask nuxt to stop listening to file changes
|
||||
test.after('Closing server and nuxt.js', t => {
|
||||
nuxt.close()
|
||||
|
Loading…
Reference in New Issue
Block a user