test: remove hook assetion in error.test.js

This commit is contained in:
Clark Du 2018-03-19 10:13:05 +08:00
parent a962210219
commit b1199f8fa4
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9
2 changed files with 0 additions and 40 deletions

View File

@ -33,38 +33,6 @@ describe('error', () => {
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 () => {
expect(() => nuxt.resolvePath()).toThrowError(TypeError)

View File

@ -1,12 +1,4 @@
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: {
stats: false
}