mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
misc(test): json format error
This commit is contained in:
parent
b7d54b2c75
commit
0aea0d532c
@ -159,6 +159,23 @@ describe('basic ssr', () => {
|
|||||||
// expect(errorSpy.args[0][0].message.includes('Error mouahahah')).toBe(true)
|
// expect(errorSpy.args[0][0].message.includes('Error mouahahah')).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('/error json format error', async () => {
|
||||||
|
const opts = {
|
||||||
|
headers: {
|
||||||
|
accept: 'application/json'
|
||||||
|
},
|
||||||
|
resolveWithFullResponse: true
|
||||||
|
}
|
||||||
|
await expect(rp(url('/error'), opts)).rejects.toMatchObject({
|
||||||
|
statusCode: 500,
|
||||||
|
response: {
|
||||||
|
headers: {
|
||||||
|
'content-type': 'text/json; charset=utf-8'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
test('/error2', async () => {
|
test('/error2', async () => {
|
||||||
const { html, error } = await nuxt.renderRoute('/error2')
|
const { html, error } = await nuxt.renderRoute('/error2')
|
||||||
expect(html.includes('Custom error')).toBe(true)
|
expect(html.includes('Custom error')).toBe(true)
|
||||||
|
Loading…
Reference in New Issue
Block a user