mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
test: disable terser/minify by default (#6290)
This commit is contained in:
parent
9ad02c4017
commit
3a125b09d1
4
test/fixtures/async-config/nuxt.config.js
vendored
4
test/fixtures/async-config/nuxt.config.js
vendored
@ -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!'
|
||||
}
|
||||
|
@ -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 () => {
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user