mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
test: remove hook assetion in error.test.js
This commit is contained in:
parent
a962210219
commit
b1199f8fa4
@ -33,38 +33,6 @@ describe('error', () => {
|
|||||||
statusCode: 500
|
statusCode: 500
|
||||||
})
|
})
|
||||||
|
|
||||||
// release()
|
|
||||||
// expect(errorSpy.calledOnce).toBe(true)
|
|
||||||
// expect(errorSpy
|
|
||||||
// .getCall(0)
|
|
||||||
// .args[0].message.includes(
|
|
||||||
// 'render function or template not defined in component: anonymous'
|
|
||||||
// )).toBe(true)
|
|
||||||
})
|
|
||||||
|
|
||||||
// test('/ with text/json content', async () => {
|
|
||||||
// const opts = {
|
|
||||||
// headers: {
|
|
||||||
// accept: 'application/json'
|
|
||||||
// },
|
|
||||||
// resolveWithFullResponse: true
|
|
||||||
// }
|
|
||||||
// const errorSpy = await interceptError()
|
|
||||||
// const { response: { headers } } = await expect(rp(url('/'), opts)).toThrow()
|
|
||||||
// expect(headers['content-type']).toBe('text/json; charset=utf-8')
|
|
||||||
// release()
|
|
||||||
// expect(errorSpy.calledOnce).toBe(true)
|
|
||||||
// expect(errorSpy
|
|
||||||
// .getCall(0)
|
|
||||||
// .args[0].message.includes(
|
|
||||||
// 'render function or template not defined in component: anonymous'
|
|
||||||
// )).toBe(true)
|
|
||||||
// })
|
|
||||||
|
|
||||||
// test('Deprecated: dev in build.extend()', async () => {
|
|
||||||
// expect(logSpy.calledWith('[build:done]: hook error')).toBe(true)
|
|
||||||
// })
|
|
||||||
|
|
||||||
test('Error: resolvePath()', async () => {
|
test('Error: resolvePath()', async () => {
|
||||||
expect(() => nuxt.resolvePath()).toThrowError(TypeError)
|
expect(() => nuxt.resolvePath()).toThrowError(TypeError)
|
||||||
|
|
||||||
|
8
test/fixtures/error/nuxt.config.js
vendored
8
test/fixtures/error/nuxt.config.js
vendored
@ -1,12 +1,4 @@
|
|||||||
export default {
|
export default {
|
||||||
hooks(hook) {
|
|
||||||
hook('build:done', nuxt => {
|
|
||||||
throw new Error('hook error')
|
|
||||||
})
|
|
||||||
hook('error', ({message}, from) => {
|
|
||||||
console.log(`[${from}]: ${message}`) // eslint-disable-line no-console
|
|
||||||
})
|
|
||||||
},
|
|
||||||
build: {
|
build: {
|
||||||
stats: false
|
stats: false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user