test: deprecate build.vendor

This commit is contained in:
Clark Du 2018-04-13 15:24:30 +08:00
parent 708f602a62
commit 21334c21e0
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9

View File

@ -1,4 +1,6 @@
import { resolve } from 'path'
import consola from 'consola'
import { Nuxt, Options, version } from '../utils'
describe('basic config defaults', () => {
@ -11,4 +13,16 @@ describe('basic config defaults', () => {
const currentNodeModulesDir = resolve(__dirname, '..', '..', 'node_modules')
expect(options.modulesDir.includes(currentNodeModulesDir)).toBe(true)
})
test('vendor has been deprecated', async () => {
jest.spyOn(consola, 'warn')
const options = Options.from({
build: { vendor: 'vue' }
})
expect(options.build.vendor).toBeUndefined()
expect(consola.warn).toHaveBeenCalledWith('vendor has been deprecated due to webpack4 optimization')
consola.warn.mockRestore()
})
})