update error tests

This commit is contained in:
Pooya Parsa 2017-08-05 12:17:30 +04:30
parent 25fdb28d41
commit c709b22612
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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