From b1199f8fa4e31c0b4e556255338cc63583bfb751 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Mon, 19 Mar 2018 10:13:05 +0800 Subject: [PATCH] test: remove hook assetion in error.test.js --- test/error.test.js | 32 ------------------------------ test/fixtures/error/nuxt.config.js | 8 -------- 2 files changed, 40 deletions(-) diff --git a/test/error.test.js b/test/error.test.js index 5cc3c50ace..bf7bc4c9c7 100644 --- a/test/error.test.js +++ b/test/error.test.js @@ -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) diff --git a/test/fixtures/error/nuxt.config.js b/test/fixtures/error/nuxt.config.js index 96e260ba0b..33b2bc1b49 100644 --- a/test/fixtures/error/nuxt.config.js +++ b/test/fixtures/error/nuxt.config.js @@ -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 }