mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
test: add test for youch
This commit is contained in:
parent
72b31a217f
commit
cbd73463f8
@ -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('<div class="error-frames">'))
|
||||
})
|
||||
|
||||
// Close server and ask nuxt to stop listening to file changes
|
||||
test.after('Closing server and nuxt.js', t => {
|
||||
nuxt.close()
|
||||
|
12
test/fixtures/debug/pages/error.vue
vendored
Normal file
12
test/fixtures/debug/pages/error.vue
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<template>
|
||||
<h1>Error page</h1>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint no-undef: 0 */
|
||||
export default {
|
||||
data () {
|
||||
throw new Error('test youch !')
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user