From 3a125b09d1419dc1ca1af818eebe4fc0e868f673 Mon Sep 17 00:00:00 2001 From: Pim Date: Sat, 24 Aug 2019 16:13:03 +0200 Subject: [PATCH] test: disable terser/minify by default (#6290) --- test/fixtures/async-config/nuxt.config.js | 4 ++++ test/unit/modern.server.test.js | 4 ++-- test/utils/nuxt.js | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/test/fixtures/async-config/nuxt.config.js b/test/fixtures/async-config/nuxt.config.js index ffeef06992..473a778550 100644 --- a/test/fixtures/async-config/nuxt.config.js +++ b/test/fixtures/async-config/nuxt.config.js @@ -1,6 +1,10 @@ const createData = async () => { await new Promise(resolve => setTimeout(resolve, 500)) return { + build: { + // without terser enabled the size-limit unit test fails + terser: true + }, head: { title: 'Async Config!' } diff --git a/test/unit/modern.server.test.js b/test/unit/modern.server.test.js index 704609069c..a310967279 100644 --- a/test/unit/modern.server.test.js +++ b/test/unit/modern.server.test.js @@ -35,12 +35,12 @@ describe('modern server mode', () => { test('should include es6 syntax in modern resources', async () => { const response = await rp(url(`/_nuxt/modern-${wChunk('pages/index.js')}`)) - expect(response).toContain('arrow:()=>"build test"') + expect(response).toContain('arrow: () => {') }) test('should not include es6 syntax in normal resources', async () => { const response = await rp(url(`/_nuxt/${wChunk('pages/index.js')}`)) - expect(response).toContain('arrow:function(){return"build test"}') + expect(response).toContain('arrow: function arrow() {') }) test('should contain legacy http2 pushed resources', async () => { diff --git a/test/utils/nuxt.js b/test/utils/nuxt.js index 05a7c11f98..81d02c6044 100644 --- a/test/utils/nuxt.js +++ b/test/utils/nuxt.js @@ -33,5 +33,14 @@ export const loadFixture = async function (fixture, overrides) { config.dev = false config.test = true + // disable terser to speed-up fixture builds + if (config.build) { + if (!config.build.terser) { + config.build.terser = false + } + } else { + config.build = { terser: false } + } + return defaultsDeep({}, overrides, config) }