From ac836c77de09e5862162d2c45513719ca9f1dd93 Mon Sep 17 00:00:00 2001 From: Sebastien Chopin Date: Thu, 11 May 2017 13:37:21 +0200 Subject: [PATCH] Update tests --- lib/generate.js | 4 ++++ test/fixtures/with-config/nuxt.config.js | 3 ++- test/with-config.test.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/generate.js b/lib/generate.js index 70769a65b0..0f5222abe8 100644 --- a/lib/generate.js +++ b/lib/generate.js @@ -104,13 +104,16 @@ export default function () { errors.push({ type: 'handled', route, error }) } } catch (err) { + /* istanbul ignore next */ errors.push({ type: 'unhandled', route, error: err }) return } try { var minifiedHtml = minify(html, self.options.generate.minify) } catch (err) { + /* istanbul ignore next */ let minifyErr = new Error(`HTML minification failed. Make sure the route generates valid HTML. Failed HTML:\n ${html}`) + /* istanbul ignore next */ errors.push({ type: 'unhandled', route, error: minifyErr }) return } @@ -137,6 +140,7 @@ export default function () { if (errors.length) { const report = errors.map(({ type, route, error }) => { + /* istanbul ignore next */ if (type === 'unhandled') { return `Route: '${route}'\n${error.stack}` } else { diff --git a/test/fixtures/with-config/nuxt.config.js b/test/fixtures/with-config/nuxt.config.js index b1aec4f60d..d69accdc5c 100644 --- a/test/fixtures/with-config/nuxt.config.js +++ b/test/fixtures/with-config/nuxt.config.js @@ -23,6 +23,7 @@ module.exports = { string: 'Nuxt.js' }, build: { + extractCSS: true, publicPath: '/orion/', analyze: { analyzerMode: 'disabled', @@ -33,6 +34,6 @@ module.exports = { } }, css: [ - {src: '~/assets/app.css'} + { src: '~/assets/app.css' } ] } diff --git a/test/with-config.test.js b/test/with-config.test.js index 862bbf4901..e14e6bb479 100644 --- a/test/with-config.test.js +++ b/test/with-config.test.js @@ -87,7 +87,7 @@ test('/test/about-bis (added with extendRoutes)', async t => { test('Check stats.json generated by build.analyze', t => { const stats = require(resolve(__dirname, 'fixtures/with-config/.nuxt/dist/stats.json')) - t.is(stats.assets.length, 27) + t.is(stats.assets.length, 29) }) // Close server and ask nuxt to stop listening to file changes