diff --git a/test/basic.generate.test.js b/test/basic.generate.test.js index 7799a1750f..9b828032f5 100644 --- a/test/basic.generate.test.js +++ b/test/basic.generate.test.js @@ -116,12 +116,6 @@ test('/redirect -> check redirected source', async t => { t.true(html.includes('

Index page

')) }) -test('/error', async t => { - const window = await nuxt.renderAndGetWindow(url('/error')) - const html = window.document.body.innerHTML - t.true(html.includes('Error mouahahah')) -}) - // Close server and ask nuxt to stop listening to file changes test.after('Closing server', t => { server.close() diff --git a/test/basic.test.js b/test/basic.test.js index 6afc42226a..1c6c372456 100755 --- a/test/basic.test.js +++ b/test/basic.test.js @@ -100,10 +100,11 @@ test('/redirect -> check redirected source', async t => { }) test('/error', async t => { - const { html, error } = await nuxt.renderRoute('/error') - t.true(html.includes('Error mouahahah')) - t.true(error.message.includes('Error mouahahah')) - t.true(error.statusCode === 500) + try { + await nuxt.renderRoute('/error', { req: {}, res: {} }) + } catch (err) { + t.true(err.message.includes('Error mouahahah')) + } }) test('/error status code', async t => { diff --git a/test/fixtures/basic/pages/error.vue b/test/fixtures/basic/pages/error.vue index 8926c5b9e6..19704e7ade 100644 --- a/test/fixtures/basic/pages/error.vue +++ b/test/fixtures/basic/pages/error.vue @@ -4,8 +4,11 @@