Nuxt/packages/config/test/config/_common.test.js
2019-01-14 17:40:15 +00:00

15 lines
645 B
JavaScript

import commonConfig from '../../src/config/_common'
describe('config: common', () => {
test('should return globals with given globalName', () => {
const globalName = 'nuxt_global'
const { globals } = commonConfig()
expect(globals.id(globalName)).toEqual(`__nuxt_global`)
expect(globals.nuxt(globalName)).toEqual(`$nuxt_global`)
expect(globals.context(globalName)).toEqual(`__NUXT_GLOBAL__`)
expect(globals.pluginPrefix(globalName)).toEqual('nuxt_global')
expect(globals.readyCallback(globalName)).toEqual(`onNuxt_globalReady`)
expect(globals.loadedCallback(globalName)).toEqual(`_onNuxt_globalLoaded`)
})
})