Skip to content

Commit 16b4ec4

Browse files
committed
options provide should allow symbol keys
1 parent 9627a80 commit 16b4ec4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/test-utils/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export interface VueTestUtilsConfigOptions {
180180
stubs: Record<string, Component | boolean | string>
181181
mocks: Record<string, any>
182182
methods: Record<string, Function>
183-
provide?: Record<string, any>,
183+
provide?: Record<string | symbol, any>,
184184
showDeprecationWarnings?: boolean
185185
deprecationWarningHandler?: Function
186186
}

packages/test-utils/types/test/mount.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Vuex from 'vuex'
22
import VueTestUtils, { mount, createLocalVue, config } from '../'
33
import { normalOptions, functionalOptions, ClassComponent, extendedFunctionalComponent, extendedNormalComponent } from './resources'
4+
import type { InjectKey } from 'vue/types/options'
45

56
/**
67
* Should create wrapper vm based on (function) component options or constructors
@@ -99,7 +100,7 @@ config.stubs = {
99100
}
100101
config.stubs['quuux'] = true
101102
config.mocks = {
102-
foo: 'bar',
103+
foo: 'bar'
103104
}
104105
config.mocks['foo'] = {
105106
bar: 'baz'
@@ -109,8 +110,10 @@ config.methods = {
109110
}
110111
config.methods['foo'] = () => true
111112
config.provide = {
112-
foo: {}
113+
foo: {},
114+
[Symbol('injection key')]: {}
113115
}
116+
114117
config.provide['foo'] = {
115118
bar: {}
116119
}

0 commit comments

Comments
 (0)