mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
b4d81dc584
* lint: require await in async function * lint: replace "error" with 2 in config
29 lines
863 B
JavaScript
29 lines
863 B
JavaScript
import { resolve } from 'path'
|
|
import consola from 'consola'
|
|
|
|
import { Nuxt, Options, version } from '../utils'
|
|
|
|
describe('basic config defaults', () => {
|
|
test('Nuxt.version is same as package', () => {
|
|
expect(Nuxt.version).toBe(version)
|
|
})
|
|
|
|
test('modulesDir uses /node_modules as default if not set', () => {
|
|
const options = Options.from({})
|
|
const currentNodeModulesDir = resolve(__dirname, '..', '..', 'node_modules')
|
|
expect(options.modulesDir.includes(currentNodeModulesDir)).toBe(true)
|
|
})
|
|
|
|
test('vendor has been deprecated', () => {
|
|
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()
|
|
})
|
|
})
|