From 21334c21e060461bbe82be8641dead2a08adea82 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Fri, 13 Apr 2018 15:24:30 +0800 Subject: [PATCH] test: deprecate build.vendor --- test/unit/basic.config.defaults.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/unit/basic.config.defaults.test.js b/test/unit/basic.config.defaults.test.js index c6d9b85647..5e34e93e29 100644 --- a/test/unit/basic.config.defaults.test.js +++ b/test/unit/basic.config.defaults.test.js @@ -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() + }) })