Skip to content

Commit 3ba4e15

Browse files
authored
Merge pull request #236 from vuejs/feat/config-globals
feat: default values for global.config
2 parents d6e1ac8 + 3b1fd83 commit 3ba4e15

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

src/config.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { VueWrapper } from './vueWrapper'
44
import { DOMWrapper } from './domWrapper'
55

66
interface GlobalConfigOptions {
7-
global: GlobalMountOptions
7+
global: Required<GlobalMountOptions>
88
plugins: {
99
VueWrapper: Pluggable<VueWrapper<ComponentPublicInstance>>
1010
DOMWrapper: Pluggable<DOMWrapper<Element>>
@@ -56,7 +56,15 @@ export const config: GlobalConfigOptions = {
5656
stubs: {
5757
transition: true,
5858
'transition-group': true
59-
}
59+
},
60+
provide: {},
61+
components: {},
62+
config: {},
63+
directives: {},
64+
mixins: [],
65+
mocks: {},
66+
plugins: [],
67+
renderStubDefaultSlot: false
6068
},
6169
plugins: {
6270
VueWrapper: new Pluggable(),

tests/config.spec.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ import Hello from './components/Hello.vue'
55
describe('config', () => {
66
beforeEach(() => {
77
config.global = {
8-
components: undefined,
9-
directives: undefined,
10-
mixins: undefined,
11-
plugins: undefined,
12-
mocks: undefined,
13-
provide: undefined
8+
components: {},
9+
directives: {},
10+
mixins: [],
11+
plugins: [],
12+
mocks: {},
13+
provide: {},
14+
stubs: {},
15+
config: {},
16+
renderStubDefaultSlot: false
1417
}
1518

1619
jest.clearAllMocks()

0 commit comments

Comments
 (0)