mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
update error tests
This commit is contained in:
parent
25fdb28d41
commit
c709b22612
@ -280,7 +280,7 @@ export default class Renderer extends Tapable {
|
||||
// ensure statusCode, message and name fields
|
||||
err.statusCode = err.statusCode || 500
|
||||
err.message = err.message || 'Nuxt Server Error'
|
||||
err.name = err.name || 'Nuxt Server Error'
|
||||
err.name = (!err.name || err.name === 'Error') ? 'Nuxt Server Error' : err.name
|
||||
|
||||
const sendResponse = (content, type = 'text/html') => {
|
||||
// Set Headers
|
||||
|
@ -34,8 +34,8 @@ test('/404 should display an error too', async t => {
|
||||
|
||||
test('/ with renderAndGetWindow()', async t => {
|
||||
const err = await t.throws(nuxt.renderAndGetWindow(url('/')))
|
||||
t.true(String(err).includes('Error: socket hang up'))
|
||||
// t.is(err.response.statusCode, 500)
|
||||
t.is(err.response.statusCode, 500)
|
||||
t.is(err.response.statusMessage, 'Nuxt Server Error')
|
||||
})
|
||||
|
||||
// Close server and ask nuxt to stop listening to file changes
|
||||
|
Loading…
Reference in New Issue
Block a user