Skip to content

Commit

Permalink
Merge pull request #236 from vuejs/feat/config-globals
Browse files Browse the repository at this point in the history
feat: default values for global.config
  • Loading branch information
lmiller1990 committed Nov 8, 2020
2 parents d6e1ac8 + 3b1fd83 commit 3ba4e15
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
12 changes: 10 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { VueWrapper } from './vueWrapper'
import { DOMWrapper } from './domWrapper'

interface GlobalConfigOptions {
global: GlobalMountOptions
global: Required<GlobalMountOptions>
plugins: {
VueWrapper: Pluggable<VueWrapper<ComponentPublicInstance>>
DOMWrapper: Pluggable<DOMWrapper<Element>>
Expand Down Expand Up @@ -56,7 +56,15 @@ export const config: GlobalConfigOptions = {
stubs: {
transition: true,
'transition-group': true
}
},
provide: {},
components: {},
config: {},
directives: {},
mixins: [],
mocks: {},
plugins: [],
renderStubDefaultSlot: false
},
plugins: {
VueWrapper: new Pluggable(),
Expand Down
15 changes: 9 additions & 6 deletions tests/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import Hello from './components/Hello.vue'
describe('config', () => {
beforeEach(() => {
config.global = {
components: undefined,
directives: undefined,
mixins: undefined,
plugins: undefined,
mocks: undefined,
provide: undefined
components: {},
directives: {},
mixins: [],
plugins: [],
mocks: {},
provide: {},
stubs: {},
config: {},
renderStubDefaultSlot: false
}

jest.clearAllMocks()
Expand Down

0 comments on commit 3ba4e15

Please sign in to comment.