From cbd73463f8f9231a7a6786e3fed64a57b073b377 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Mon, 30 Oct 2017 11:31:08 +0800 Subject: [PATCH] test: add test for youch --- test/debug.test.js | 8 ++++++++ test/fixtures/debug/pages/error.vue | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/fixtures/debug/pages/error.vue diff --git a/test/debug.test.js b/test/debug.test.js index f9d2d5ba23..d19ebe955d 100644 --- a/test/debug.test.js +++ b/test/debug.test.js @@ -30,6 +30,14 @@ test('Check /test/_open with error (open-in-editor)', async t => { t.is(body, 'File is not specified') }) +test('Check /test/error (Youch)', async t => { + 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('
')) +}) + // Close server and ask nuxt to stop listening to file changes test.after('Closing server and nuxt.js', t => { nuxt.close() diff --git a/test/fixtures/debug/pages/error.vue b/test/fixtures/debug/pages/error.vue new file mode 100644 index 0000000000..ed9d681ade --- /dev/null +++ b/test/fixtures/debug/pages/error.vue @@ -0,0 +1,12 @@ + + +