mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-15 02:14:44 +00:00
31 lines
768 B
JavaScript
31 lines
768 B
JavaScript
import { getDefaultNuxtConfig } from '../../src/config'
|
|
|
|
jest.mock('std-env', () => ({
|
|
isBrowser: false,
|
|
isTest: true,
|
|
isDevelopment: false,
|
|
isProduction: true,
|
|
isDebug: false,
|
|
isCI: true,
|
|
isWindows: false,
|
|
isMacOS: false,
|
|
isLinux: true
|
|
}))
|
|
|
|
describe('config', () => {
|
|
test('should return default nuxt configurations', () => {
|
|
expect(getDefaultNuxtConfig()).toMatchSnapshot()
|
|
})
|
|
|
|
test('should return nuxt configurations with custom env', () => {
|
|
const env = {
|
|
NUXT_PORT: '3001',
|
|
NUXT_HOST: 'localhost',
|
|
UNIX_SOCKET: '/var/run/nuxt.sock'
|
|
}
|
|
const config = getDefaultNuxtConfig({ env })
|
|
config.buildModules = config.buildModules.filter(p => p.name !== 'patchMD4')
|
|
expect(config).toMatchSnapshot()
|
|
})
|
|
})
|