Nuxt/packages/config/test/index.test.js
Xin Du (Clark) a616c09b22 feat(test): unit tests for core/config module (#4760)
* feat(test): enable tests in packages

* fix: wait error hook

* test: entry and hookable in core

* fix(test): options snapshot in windows

* refactor(test): simpilify jest.fn

* test: module in core

* test: complete module test

* test: add test for resolver in core

* test: update config snapshot

* test: nuxt in core module
2019-01-19 13:00:51 +01:00

17 lines
482 B
JavaScript

import { getDefaultNuxtConfig, getNuxtConfig } from '../src'
jest.mock('../src/options', () => ({
getNuxtConfig: jest.fn(() => 'nuxt config')
}))
jest.mock('../src/config', () => ({
getDefaultNuxtConfig: jest.fn(() => 'default nuxt config')
}))
describe('config: entry', () => {
test('should export getDefaultNuxtConfig and getNuxtConfig', () => {
expect(getNuxtConfig()).toEqual('nuxt config')
expect(getDefaultNuxtConfig()).toEqual('default nuxt config')
})
})